The Book of Prayers (Kitab Al-Salat)
Muslim :: Book 4 : Hadith 2092
It is reported on the authority of Ibn Juraij that the Holy Prophet (may peace be upon him) said: Should anyone amongst you see a bier he must stand up so long as it is within sight in case he does not intend to follow it.