The Book on Jana''iz (Funerals)
كتاب الجنائز عن رسول الله صلى الله عليه وسلم
Read the English translation first, with the original Arabic directly underneath.
What Has Been Related About (Performing) The (Funeral) Salat At The Grave
Yahya, the Imam of Banu Taimillah, narrated from Abu Majid :
From Abdullah bin Mas'ud who said: "We asked the Messenger of Allah about walking behind the funeral. He said: 'Less than a trot. For if he was good, then you will be hastening him to it (goodness), and if he was evil, then it id only an inhabitant of the Fire that is being taken away." The funeral is (to be) followed. The one who precedes it shall not have the reward of those who follow it.'"
مَا دُونَ الْخَبَبِ فَإِنْ كَانَ خَيْرًا عَجَّلْتُمُوهُ وَإِنْ كَانَ شَرًّا فَلاَ يُبَعَّدُ إِلاَّ أَهْلُ النَّارِ الْجَنَازَةُ مَتْبُوعَةٌ وَلاَ تَتْبَعُ وَلَيْسَ مِنْهَا مَنْ تَقَدَّمَهَا