Full Sharh — Riyad as-Salihin 251
وعنه أن رسول الله صلى الله عليه وسلم قال: "من اتبع جنازة مسلم إيماناً واحتساباً، وكان معه حتي يصلى عليها ويفرغ من دفنها، فإنه يرجع من الأجر بقيراطين كل قيراط مثل أحدٍ، ومن صلى عليها، ثم رجع قبل أن تدفن ، فإنه يرجع بقيراط” ((رواه البخاري)).
English Translation
Abu Hurairah (May Allah be pleased with him) reported:: The Messenger of Allah (ﷺ) said, "Whosoever attends the funeral of a Muslim believing and hoping for the reward from Allah and remains with it until the prayer is offered over it and the burial is completed, he will return with a reward of two Qirat; each Qirat is equivalent to Mount Uhud; and whosoever offers his prayer over it and returns before its burial, he will come back with one Qirat.".
Source
Riyad as-Salihin(رياض الصالحين)
The Book of Visiting the Sick
Hadith Number
251