If the matter is as you describe, and your friend became an atheist and did not believe in Islam, and he died in that state, as appears to be the case, then it is not permissible for the one who knew his situation to offer the funeral prayer for him or to say du’aa’ for him, or to wash him or shroud him or bury him in the Muslim graveyard, because Allaah says (interpretation of the meaning):
“It is not (proper) for the Prophet and those who believe to ask Allaah’s forgiveness for the Mushrikoon, even though they be of kin, after it has become clear to them that they are the dwellers of the Fire (because they died in a state of disbelief)”
“And never (O Muhammad صلى الله عليه وسلم) pray (funeral prayer) for any of them (hypocrites) who dies, nor stand at his grave. Certainly they disbelieved in Allaah and His Messenger, and died while they were Faasiqoon (rebellious, — disobedient to Allaah and His Messenger صلى الله عليه وسلم)”
Muslim (976) narrated that Abu Hurayrah said: The messenger of Allaah (blessings and peace of Allaah be upon him) said: “I asked my Lord for permission to pray for forgiveness for my mother but He did not give me permission. And I asked Him for permission to visit her grave and He gave me permission.”
This is evidence that it is not permissible to say du’aa’ for one who died in a state of shirk or kufr.
And Allaah knows best.