أَخْبَرَنَا عَبْدُ الرَّحْمَنِ بْنُ مُحَمَّدِ بْنِ سَلَّامٍ قَالَ حَدَّثَنَا إِسْحَقُ يَعْنِي ابْنَ يُوسُفَ بْنِ الْأَزْرَقِ عَنْ عَوْفٍ عَنْ مُحَمَّدِ بْنِ سِيرِينَ عَنْ أَبِي هُرَيْرَةَ عَنْ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ قَالَ مَنْ اتَّبَعَ جَنَازَةَ مُسْلِمٍ إِيمَانًا وَاحْتِسَابًا فَصَلَّى عَلَيْهِ ثُمَّ انْتَظَرَ حَتَّى يُوضَعَ فِي قَبْرِهِ كَانَ لَهُ قِيرَاطَانِ أَحَدُهُمَا مِثْلُ أُحُدٍ وَمَنْ صَلَّى عَلَيْهِ ثُمَّ رَجَعَ كَانَ لَهُ قِيرَاطٌ

It was narrated from Abu Hurairah that: The Prophet [SAW] said: "Whoever follows the funeral procession of a Muslim out of faith and in the hope of reward, then offers the funeral prayer for him and waits until he is placed in his grave, then he will have two Qirats, each of which is like Mount Uhud. Whoever offers the funeral prayer for him then returns, he will have one Qirat." Translation Not Available

Book Ref: Sunan An Nisai Book 47 Hadith 5032
Web Ref:  Sunan An Nisai Vol 6 Book 47 Hadith 5035