حَدَّثَنِي يَحْيَى، عَنْ مَالِكٍ، عَنْ سَعِيدِ بْنِ أَبِي سَعِيدٍ الْمَقْبُرِيِّ، عَنْ أَبِيهِ، أَنَّهُ سَأَلَ أَبَا هُرَيْرَةَ كَيْفَ تُصَلِّي عَلَى الْجَنَازَةِ فَقَالَ أَبُو هُرَيْرَةَ أَنَا لَعَمْرُ اللَّهِ، أُخْبِرُكَ أَتَّبِعُهَا، مِنْ أَهْلِهَا فَإِذَا وُضِعَتْ كَبَّرْتُ وَحَمِدْتُ اللَّهَ وَصَلَّيْتُ عَلَى نَبِيِّهِ ثُمَّ أَقُولُ اللَّهُمَّ إِنَّهُ عَبْدُكَ وَابْنُ عَبْدِكَ وَابْنُ أَمَتِكَ كَانَ يَشْهَدُ أَنْ لاَ إِلَهَ إِلاَّ أَنْتَ وَأَنَّ مُحَمَّدًا عَبْدُكَ وَرَسُولُكَ وَأَنْتَ أَعْلَمُ بِهِ اللَّهُمَّ إِنْ كَانَ مُحْسِنًا فَزِدْ فِي إِحْسَانِهِ وَإِنْ كَانَ مُسِيئًا فَتَجَاوَزْ عَنْ سَيِّئَاتِهِ اللَّهُمَّ لاَ تَحْرِمْنَا أَجْرَهُ وَلاَ تَفْتِنَّا بَعْدَهُ ‏.‏

Yahya related to me from Malik from Said ibn Abi Said al-Maqburifrom his father that he had asked Abu Hurayra, "How do you pray overthe dead?" and Abu Hurayra replied, "By the Life of Allah, I will tellyou! I follow with the family and when the corpse is put down I say'Allah is greater' and praise Allah and ask for blessings on HisProphet. Then I say, 'O Allah, he is Your slave and the son of Yourmale slave and Your female slave. He used to testify that there is nogod but You and that Muhammad is Your slave and Your Messenger, andYou know that best. O Allah, if he acted well, then increase for himhis good action, and if he acted wrongly, then overlook his wrongactions. O Allah, do not deprive us of his reward, and do not try usafter him.'" Allahumma inna huwa abduka wa'bnu abdika wa'bnuamatika. Kana yash-hadu an la ilaha illa ant wa anna Muhammadan abdukawa rasooluka, wa anta alamu bihi. Allahumma in kana muhsinan zid fiihsanihi, wa in kana musiyan fa tajawaz an sayatihi. Allahumma latahrimna ajrahu wa lataftina badahu. Translation Not Available

Book Ref: Muwatta Imam Malik Book 16 Hadith 539
Web Ref:  Muwatta Imam Malik Book 16 Hadith 17