Abu Huraira reported the Prophet as saying in the course of prayer over a dead body, “O God, Thou art its Lord, Thou didst create it, Thou didst guide it to Islam, Thou hast taken its spirit, and Thou knowest best its inner nature and outer aspect. We have come as intercessors, so forgive him.”
Malik b. Hubaira said he heard God’s messenger say, “If any Muslim dies and three rows of Muslims pray over him it will assure him .” When Malik considered those who accompanied a bier to be few, he divided them into three rows in accordance with this tradition.
Abu Dawud transmitted it. In Tirmidhi’s version he said that when Malik b. Hubaira prayed over a bier and found few people present, he divided them into three sections, then said that God’s messenger had stated, “If three rows pray over anyone it will assure him .” Ibn Majah transmitted something similar.
Sa'id b. al-Musayyib said he prayed behind Abu Huraira at the funeral of a boy who had never sinned and heard him say, “O God, protect him from the punishment in the grave.”
Anas said that when a bier came past God’s messenger and he stood up he was told that it was carrying a Jew. He replied, “I stood up simply out of respect for the angels.”