Language:
كتاب المغازى
64  
Military Expeditions led by the Prophet (pbuh) (Al-Maghaazi)
(35)
Chapter: The Ghazwa of Al-Hudaibiya
(35)
باب غَزْوَةِ الْحُدَيْبِيَةِ
Sahih al-Bukhari 4191

Narrated Ka`b bin Ujra:

We were in the company of Allah's Messenger (ﷺ) at Al-Hudaibiya in the state of Ihram and the pagans did not allow us to proceed (to the Ka`ba). I had thick hair and lice started falling on my face. The Prophet (ﷺ) passed by me and said, "Are the lice of your head troubling you?" I replied, Yes." (The sub-narrator added, "Then the following Divine Verse was revealed:-- "And if anyone of you is ill or has an ailment in his scalp, (necessitating shaving) must pay a ransom (Fida) of either fasting or feeding the poor, Or offering a sacrifice." (2.196)

حَدَّثَنِي مُحَمَّدُ بْنُ هِشَامٍ أَبُو عَبْدِ اللَّهِ، حَدَّثَنَا هُشَيْمٌ، عَنْ أَبِي بِشْرٍ، عَنْ مُجَاهِدٍ، عَنْ عَبْدِ الرَّحْمَنِ بْنِ أَبِي لَيْلَى، عَنْ كَعْبِ بْنِ عُجْرَةَ، قَالَ كُنَّا مَعَ رَسُولِ اللَّهِ صلى الله عليه وسلم بِالْحُدَيْبِيَةِ وَنَحْنُ مُحْرِمُونَ، وَقَدْ حَصَرَنَا الْمُشْرِكُونَ ـ قَالَ ـ وَكَانَتْ لِي وَفْرَةٌ فَجَعَلَتِ الْهَوَامُّ تَسَّاقَطُ عَلَى وَجْهِي، فَمَرَّ بِي النَّبِيُّ صلى الله عليه وسلم فَقَالَ ‏"‏ أَيُؤْذِيكَ هَوَامُّ رَأْسِكَ ‏"‏‏.‏ قُلْتُ نَعَمْ‏.‏ قَالَ وَأُنْزِلَتْ هَذِهِ الآيَةُ ‏{‏فَمَنْ كَانَ مِنْكُمْ مَرِيضًا أَوْ بِهِ أَذًى مِنْ رَأْسِهِ فَفِدْيَةٌ مِنْ صِيَامٍ أَوْ صَدَقَةٍ أَوْ نُسُكٍ‏}
Reference : Sahih al-Bukhari 4191
In-book reference : Book 64, Hadith 231
USC-MSA web (English) reference : Vol. 5, Book 59, Hadith 504
  (deprecated numbering scheme)