The Prophet (peace and blessings be upon him) passed by Sayyiduna Ka'b bin Ujrah (may Allah be pleased with him) while he was suffering from the lice of his head, so he (peace and blessings be upon him) ordered him to shave his head. Then revelation came, and the Prophet (peace and blessings be upon him) said: "If you wish, fast three days; if you wish, feed one faraq to six poor people; and if you wish, slaughter a goat."
Hadith Referenceالمعجم الكبير للطبراني / باب الكاف / 16275