Language:
كتاب الجنائز
23  
Funerals (Al-Janaa'iz)
(56)
Chapter: The legal way of offering the funeral prayer
(56)
باب سُنَّةِ الصَّلاَةِ عَلَى الْجَنَائِزِ
Sahih al-Bukhari 1322

Narrated Ash-Shaibani:

Ash-Shu`bi said, "Somebody who passed along with your Prophet (p.b.u.h) by a grave that was separate from the other graves informed me (saying), "The Prophet (ﷺ) led us (in the prayer) and we aligned behind him." We said, "O Abu `Amr! Who told you this narration?" He replied, "Ibn `Abbas."

حَدَّثَنَا سُلَيْمَانُ بْنُ حَرْبٍ، حَدَّثَنَا شُعْبَةُ، عَنِ الشَّيْبَانِيِّ، عَنِ الشَّعْبِيِّ، قَالَ أَخْبَرَنِي مَنْ، مَرَّ مَعَ نَبِيِّكُمْ صلى الله عليه وسلم عَلَى قَبْرٍ مَنْبُوذٍ فَأَمَّنَا فَصَفَفْنَا خَلْفَهُ‏.‏ فَقُلْنَا يَا أَبَا عَمْرٍو مَنْ حَدَّثَكَ قَالَ ابْنُ عَبَّاسٍ رضى الله عنهما‏.‏
Reference : Sahih al-Bukhari 1322
In-book reference : Book 23, Hadith 79
USC-MSA web (English) reference : Vol. 2, Book 23, Hadith 408
  (deprecated numbering scheme)