It was narrated from Ibn 'Umar that the Messenger of Allah(saw) said: "Whoever unexpectedly comes across a person suffering a calamity, and says: (Praise is to Allah Who has kept me safe from that which has afflicted you and preferred me over many of those whom He has created), will be kept safe from that calamity, no matter what it is." (Da'if)