It is narrated from the Mother of the Believers, Sayyidah Aishah (may Allah be pleased with her), that she said: I heard the Messenger of Allah (peace and blessings be upon him) say: "There is no believer who is pricked by a thorn, or suffers any hardship less than that, except that Allah, Glorified is He, wipes away a sin of his by it and increases his reward."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 6540