Talha b. ‘Abdallah b. ‘Auf said he prayed behind Ibn ‘Abbas at a funeral and he recited Fatihat al-Kltab (Qur'an, sura i). He then said that it was to let them know it was a sunna.
‘Abd ar-Rahman b. Abu Laila said that Zaid b. Arqam used to say “God is most great” four times over their dead at funerals, but once he said it five times. On being questioned about it he replied that God's messenger used to do so.
Muslim transmitted it.
God’s messenger prayed at a funeral and I have retained in my memory some of his supplication. He was saying, “O God, forgive him, show him mercy, grant him security, pardon him, grant him a noble provision and a spacious lodging, wash him with water, snow and ice, purify him from sins as Thou hast purified the white garment from filth, give him a better abode in place of his present one, a better family in place of his present one, and a better spouse in place of his present one, cause him to enter paradise and preserve him from the trial in the grave and the punishment in hell.” A version has “And guard him from the trial in the grave and the punishment in hell.” He added that the result was that he wished he had been that dead man.
He said the Prophet gave the people news of the death of the Negus on the day on which he died, took them out to the place of prayer, drew them up in rows and said “God is most great” four times.