Sayyiduna Ibn Umar (may Allah be pleased with them both) says that when the Prophet (peace and blessings be upon him) placed the deceased in the grave, he would say: "Bismillah, wa 'ala sunnati Rasulillah" (In the name of Allah, and upon the Sunnah of the Messenger of Allah).
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 7058
Waki' narrates likewise from Hammam that the Messenger of Allah (peace and blessings be upon him) said: "When you place your dead in their graves, say: 'Bismillah wa 'ala sunnati Rasulillah' (In the name of Allah and upon the Sunnah of the Messenger of Allah (peace and blessings be upon him))."
Only Hammam bin Yahya narrated it as marfu' (attributed to the Prophet) with this chain, and he is thiqah (trustworthy); however, Shu'bah and Hisham al-Dastuwa'i narrated it from Qatadah as mawquf (stopping) on Ibn Umar.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 7059
In Shu'bah's narration (Abu al-Siddiq) said: I was present with Ibn Umar (may Allah be pleased with them both) when he placed a deceased person in the grave, and he said: "Bismillah wa 'ala millati Rasulillah" (In the name of Allah, and upon the religion of the Messenger of Allah (peace and blessings be upon him)).
It has also been narrated through another route from Ibn Umar as marfu' with additional words, but it is weak.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 7060
Sa'id bin al-Musayyab (may Allah have mercy on him) says: I was present with Sayyiduna Abdullah bin Umar (may Allah be pleased with them both) at a funeral. When it was placed in the niche grave, he said: "Bismillah wa fi sabilillah wa 'ala millati Rasulillah" (In the name of Allah, in the path of Allah, and upon the way of the Messenger of Allah (peace and blessings be upon him)). When they began setting the bricks over the niche, he said: "Allahumma ajirha min al-shaytan wa min adhab al-qabr wa min adhab al-nar" (O Allah, protect him from Satan, from the punishment of the grave and from the punishment of the Fire). When the earth had been levelled over it, he stood at one side of the grave and said: "Allahumma jafi al-arda an juththatiha, wa sa''id biruhiha, wa laqqiha minka ridwanan" (O Allah, keep the earth away from his body, raise up his soul, and grant him Your good pleasure). I said to Sayyiduna Ibn Umar (may Allah be pleased with them both): Is this something you heard from the Messenger of Allah (peace and blessings be upon him), or something you have said from your own opinion? He said: In that case I could say whatever I wished! Rather, I heard it from the Messenger of Allah (peace and blessings be upon him) himself.
Abu Ahmad (Ibn Adi) said: This is how it names Idris bin Subayh al-Awdi, but he is in fact Idris bin Yazid al-Awdi; and I know of no one who narrates it other than this Hammad bin Abd al-Rahman, and he narrates little.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 7061
Sayyiduna al-Bayadi (may Allah be pleased with him) narrates from the Prophet (peace and blessings be upon him) the like of Waki's narration from Hammam, except that he said: "Wa billahi wa 'ala millati Rasulillah (peace and blessings be upon him)" (With Allah, and upon the religion of the Messenger of Allah (peace and blessings be upon him)).
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 7062
Umayr bin Sa'id al-Nakha'i says: I was present with Ali bin Abi Talib (may Allah be pleased with him) when he placed a deceased person in the grave, and he said: "Allahumma abduka ibnu abdika nazala bika wa anta khayru manzulin bihi, wa la na'lamu illa khayran wa anta a'lamu bihi, kana yashhadu an la ilaha illallah wa anna Muhammadan Rasulullah, faghfir lahu dhanbahu wa wassi' lahu fi mudkhalihi" (O Allah, this is Your servant, the son of Your servant; he has come to You, and You are the best of hosts. We know nothing of him but good, and You know him better. He used to bear witness that there is none worthy of worship except You alone and that Muhammad (peace and blessings be upon him) is the Messenger of Allah; so forgive him his sins and make his grave spacious for him).
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 7063