The description of the Janazah (Funeral) Prayer
Question :
I would like for you all to clarify the manner of the prayer over the deceased person just as it is confirmed from the Prophet because many of the people are ignorant of it.
Answer:
The description of the prayer over the deceased has been explained by the Prophet and his Companions. It is that the person first says 'Allahu Akbar' (Allâh is the Most Great). Then he seeks refuge with Allâh from the accursed Satan, and says 'Bismillahir-Rahmanir-Rahim' (In the Name of Allâh, the Most Gracious, the Most Merciful) and recites Al- Fatihah and a short Surah or some Verses (of Qur'an). Then the person says 'Allahu Akbar' (again) and sends blessings upon the Prophet, just as he does at the end of the regular prayer (As- Salah). Then he says 'Allahu Akbar' a third time and he supplicates for the deceased. It is preferred for him to say:
"O Allah, forgive our living and our dead, our present ones and our absent ones, our children and our elders, our males and our females. O Allah, whoever You give life to among us, then give him life upon Islam, and whoever You cause to die among us, then let him die upon Faith.
O Allah, forgive him, have mercy upon him, give him well-being, pardon him, give him a place of honor, expand his entry and wash him with water, hail and snow. Cleanse him from his sins, just as the white garment is cleansed from dirt. O Allah, transfer him to a home that is better than his home and a family that is better than his family. O Allah, enter him into Paradise and protect him from the punishment of the grave and the punishment of the Fire
Make his grave spacious for him and give him light in it. O Allah, do not prevent us from his reward and do not misguide us after him."
All of this is preserved from the Prophet. If the person supplicates for him with some other supplication, there is no harm in that. For example if one says:
"If he was good, increase his goodness; and if he was evil, overlook his evils.
"O Allah, forgive him and make him firm with the firm statement. "
Then the person says 'Allahu Akbar' a fourth time and remains standing for a short time. Then he makes one salutation of peace to his right side, saying 'As-Salamu Alaikum wa Rahmatullah' (Peace be upon you and the mercy of Allâh). It is recommended for him to raise his hands with each saying of 'Allahu Akbar', as this is confirmed from the Prophet and some of his Companions.
It is from the Sunnah for the Imam to stand at the head of the (deceased) man and at the middle of the (deceased) woman, as this is confirmed from the Prophet in a Hadith related by Anas and Samurah bin Jundub, may Allâh be pleased with them. In reference to the saying of some of the scholars that the Sunnah is to stand at the chest of the man, this is a weak statement that has no evidence for it as far as we know. When the deceased person is being prayed over, he should be placed facing the direction of the Qiblah. This is due to the Prophet's statement about the Ka'bah:
"Verily, it is the Qiblah of the Muslims, both their living and their dead."
And Allâh is the Giver of Success.
Source:
Ash-Shaykh Ibn Baz
Fatawa Islamiyah, Vol. 3 Pages 58-59-60