When I was leaving for the States, Khalaji called me to her and said, I have a dua for you which you should recite when you see someone with a bad illness………I am sharing it with you:
All day long a physician or a health care worker may see disease and disability. Isn’ t it time to remember Allah and show gratitude for His (Subhanawataala’s ) blessings upon us who walk away unafflicted by what we have witnessed?
Here is a dua from Prophet Muhammad which should be said when you see someone with an affliction, but it should be said quietly so that the person afflicted cannot hear:
Alhamdollilahil ladhi afani mimabtalaka bayhi wa faddalani Ala kaseerin miman Khalaqa tafdheelan.
All praise is for Allah, the One who saved me from that which He has tested you with and Who has favored me over much of His creation, (that I) would not be affected with that trial”
At Tirmidhi Hadith 3431 The Book of Supplications