(21) The Book of Funerals
كتاب الجنائز
(45) Chapter: The Command To Stand Up for A Funeral
(45) باب الأَمْرِ بِالْقِيَامِ لِلْجَنَازَةِ ‏
Sunan an-Nasa'i 1915 
It was narrated from 'Amir bin Rabi'ah that the Prophet said:
"When any one of you sees a funeral and is not walking with it, let him stand up until it has passed him, or until (the body) is placed (in the grave) before if passes him."
أَخْبَرَنَا قُتَيْبَةُ، قَالَ حَدَّثَنَا اللَّيْثُ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، عَنْ عَامِرِ بْنِ رَبِيعَةَ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏ "‏ إِذَا رَأَى أَحَدُكُمُ الْجَنَازَةَ فَلَمْ يَكُنْ مَاشِيًا مَعَهَا فَلْيَقُمْ حَتَّى تُخَلِّفَهُ أَوْ تُوضَعَ مِنْ قَبْلِ أَنْ تُخَلِّفَهُ ‏"‏ ‏.‏
Grade :  Sahih (Darussalam)
Reference : Sunan an-Nasa'i 1915
In-book reference : Book 21, Hadith 98
English translation : Vol. 3, Book 21, Hadith 1916