Do these vermins trouble you? I said: Yes. Thereupon he said: Then shave your head; and it was in connection with me that this verse was revealed:" Whoever among you is sick or has an ailment of the head, he (may effect) a compensation by fasting or alms or a sacrifice". He (the Holy Prophet, therefore) said to me: Observe fast for three days or give a quantity of alms enough to feed six needy persons or offer sacrifice (of an animal) that is available.
أَنَّ رَسُولَ اللَّهِ ﷺ وَقَفَ عَلَيْهِ وَرَأْسُهُ يَتَهَافَتُ قَمْلاً فَقَالَ أَيُؤْذِيكَ هَوَامُّكَ قُلْتُ نَعَمْ قَالَ فَاحْلِقْ رَأْسَكَ قَالَ فَفِيَّ نَزَلَتْ هَذِهِ الآيَةُ { فَمَنْ كَانَ مِنْكُمْ مَرِيضًا أَوْ بِهِ أَذًى مِنْ رَأْسِهِ فَفِدْيَةٌ مِنْ صِيَامٍ أَوْ صَدَقَةٍ أَوْ نُسُكٍ} فَقَالَ لِي رَسُولُ اللَّهِ ﷺ صُمْ ثَلاَثَةَ أَيَّامٍ أَوْ تَصَدَّقْ بِفَرَقٍ بَيْنَ سِتَّةِ مَسَاكِينَ أَوِ انْسُكْ مَا تَيَسَّرَ