I heard the Prophet ﷺ say (while offering prayer on a dead body): O Allah! forgive him, have mercy upon him. Give him peace and absolve him. Receive him with honour and make his grave spacious. Wash him with water, snow and hail, cleanse him from faults as is cleaned a white garment from impurity. Requite him with an abode more excellent than his abode, with a family better than his family, and with a mate better than his mate, and save him from the trial of the grave and torment of Hell. 'Auf b. Malik said: I earnestly desired that I were the dead person to receive the prayer of the Messenger of Allah ﷺ as this dead body had (received).
سَمِعْتُ النَّبِيَّ ﷺ وَصَلَّى عَلَى جَنَازَةٍ يَقُولُ اللَّهُمَّ اغْفِرْ لَهُ وَارْحَمْهُ وَاعْفُ عَنْهُ وَعَافِهِ وَأَكْرِمْ نُزُلَهُ وَوَسِّعْ مُدْخَلَهُ وَاغْسِلْهُ بِمَاءٍ وَثَلْجٍ وَبَرَدٍ وَنَقِّهِ مِنَ الْخَطَايَا كَمَا يُنَقَّى الثَّوْبُ الأَبْيَضُ مِنَ الدَّنَسِ وَأَبْدِلْهُ دَارًا خَيْرًا مِنْ دَارِهِ وَأَهْلاً خَيْرًا مِنْ أَهْلِهِ وَزَوْجًا خَيْرًا مِنْ زَوْجِهِ وَقِهِ فِتْنَةَ الْقَبْرِ وَعَذَابَ النَّارِ قَالَ عَوْفٌ فَتَمَنَّيْتُ أَنْ لَوْ كُنْتُ أَنَا الْمَيِّتَ لِدُعَاءِ رَسُولِ اللَّهِ ﷺ عَلَى ذَلِكَ الْمَيِّتِ