Short answer
No. The specific "namaz e wahshat" said to be prayed on the night after a burial, with set surahs and a set number of recitations, has no authentic basis in the hadith. You may pray ordinary voluntary prayer and ask Allah to give its reward to the deceased, and du'a, istighfar and charity for them are all established.
Treating namaz e wahshat as a sunnah, or believing it must be prayed, is not correct, since the narration for it is not established. In the Hanafi school gifting the reward of any good deed, including nafl prayer, to the dead is permissible, so a person may pray two rakats of ordinary nafl and make du'a for the deceased without the special formula.
The four schools agree on this.
Explanation
In parts of South Asia people are told to pray two rakats on the first night after a burial, reciting Ayat al-Kursi, Surah al-Takathur or al-Ikhlas a set number of times, to ease the loneliness (wahshat) of the grave. This prayer is found in some popular books, but hadith scholars have not found a reliable chain for it, and it is not accepted as an established hadith. Scholars of the Deobandi tradition have answered that it has no basis in the Sunnah.
What is established for the deceased:
- Du'a and istighfar: the Prophet ﷺ said that when a person dies his deeds stop except three, one of which is a righteous child who prays for him. Standing at the grave after burial and asking Allah to keep the deceased firm is also sunnah.
- Charity on their behalf, especially sadaqah jariyah.
- Gifting reward (isal al-thawab): in the Hanafi school you may recite Quran, pray nafl or do any good deed and ask Allah to give its reward to the deceased.
So what should you do? If you want to pray on that night, pray two rakats of ordinary nafl with any surahs and make sincere du'a for the deceased. Do not treat a special method as required, do not believe the deceased will suffer if it is not done, and do not pressure grieving family to perform it. Avoid making it a fixed custom that people feel bound to follow.
See du'a for the deceased, du'a for deceased parents and barzakh and the afterlife.
The evidence
Sahih Muslim 1631
Sahih... إذا مات الإنسان انقطع عنه عمله إلا من ثلاثة ...
"When a person dies, his deeds come to an end except for three: ongoing charity, beneficial knowledge, or a righteous child who prays for him."
Du'a and charity for the dead are established.
Sahih al-Bukhari 2697
Sahih... من أحدث في أمرنا هذا ما ليس فيه فهو رد ...
"Whoever introduces into this matter of ours something that is not from it, it is rejected."
A specific act of worship with no basis should not be treated as part of the religion.
Where the ruling is recorded
- Radd al-Muhtar (Ibn Abidin), Kitab al-Salah, chapter on the funeral, on gifting reward to the dead. A person may give the reward of his deeds, including prayer and recitation, to another.
- Fatawa Mahmudiyya, Chapter on bid'ah and customs relating to the dead. Special prayers for the dead with set formulas and no basis in the Sunnah are not to be treated as established.
Checked by our team. For a more accurate answer to your own situation, consult a scholar. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.