The Prophet said: "Whoever consoles a person with an affliction, then he gets the same reward as him."
Jami` at-Tirmidhi Book 10, Hadith 109