What to say if you see someone afflicted by misfortune

(Alhamdu lillahil-lathee AAafanee mimmab-talaka bih, wafaddalanee AAala katheerin mimman khalaqa tafdeela.)

(All praise is for Allah Who saved me from that which He tested you with and Who most certainly favoured me over much of His creation.)

API