(5) CHAPTER. The statement of Allah: … And whosoever of you is ill or has an ailment in his scalp, (necessitating shaving), he must pay a Fidya (ransom), of either observing Saum (fasts) (three days), or giving Sadaqa (charity - feeding six poor persons), or offer sacrifice (one sheep) ...” (V.2:196)
Narrated `Abdur-Rahman bin Abu Layla: Ka`b bin 'Ujra said that Allah's Apostle said to him (Ka`b), Perhaps your lice have troubled you? Ka`b replied, Yes! O Allah's Apostle. Allah's Apostle said, Have your head shaved and then either fast three days or feed six poor persons or slaughter one sheep as a sacrifice.