Language:
كتاب الجنائز
23  
Funerals (Al-Janaa'iz)
(50)
Chapter: Men, and not women, are to carry the coffin
(50)
باب حَمْلِ الرِّجَالِ الْجِنَازَةَ دُونَ النِّسَاءِ
Sahih al-Bukhari 1314

Narrated Abu Sa`id Al-Khudri:

Allah's Messenger (ﷺ) said, When the funeral is ready and the men carry it on their shoulders, if the deceased was righteous it will say, 'Present me (hurriedly),' and if he was not righteous, it will say, 'Woe to it (me)! Where are they taking it (me)?' Its voice is heard by everything except man and if he heard it he would fall unconscious."

حَدَّثَنَا عَبْدُ الْعَزِيزِ بْنُ عَبْدِ اللَّهِ، حَدَّثَنَا اللَّيْثُ، عَنْ سَعِيدٍ الْمَقْبُرِيِّ، عَنْ أَبِيهِ، أَنَّهُ سَمِعَ أَبَا سَعِيدٍ الْخُدْرِيَّ ـ رضى الله عنه ـ أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ ‏ "‏ إِذَا وُضِعَتِ الْجِنَازَةُ وَاحْتَمَلَهَا الرِّجَالُ عَلَى أَعْنَاقِهِمْ، فَإِنْ كَانَتْ صَالِحَةً قَالَتْ قَدِّمُونِي‏.‏ وَإِنْ كَانَتْ غَيْرَ صَالِحَةٍ قَالَتْ يَا وَيْلَهَا أَيْنَ يَذْهَبُونَ بِهَا يَسْمَعُ صَوْتَهَا كُلُّ شَىْءٍ إِلاَّ الإِنْسَانَ، وَلَوْ سَمِعَهُ صَعِقَ ‏"‏‏.‏
Reference : Sahih al-Bukhari 1314
In-book reference : Book 23, Hadith 71
USC-MSA web (English) reference : Vol. 2, Book 23, Hadith 400
  (deprecated numbering scheme)