Sayyiduna Abdullah bin Amr (may Allah be pleased with them both) narrates that the Prophet (peace and blessings be upon him) said: "Indeed, when a servant follows a good way in his worship and then falls ill, it is said to the angel who is appointed (over him): 'Write for him the reward of the deeds he used to do in the state of health, until I restore him to health or take him to Myself.'"
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجنائز / 6546