Your Lord says, "Call on Me and I will answer you. Those who are too proud to worship Me will enter Hell abject." (Qur'an, 40:60)
According to the Qur'an, prayer, meaning "calling, giving expression, requesting, seeking help," is a person's turning sincerely to Allah, and seeking help from Him, the Almighty, the Compassionate and Merciful, in the knowledge that he is a dependent being. Illness is one of those instances when a person feels this dependence most and draws closer to Allah. Furthermore, sickness is a test, devised in His Wisdom, that takes place by His Will, and is a warning to remind people of the transience and imperfection of this life, and is also a source of recompense in the Hereafter for the patient and submissive.
Those without faith, on the other hand, imagine that the way to recovery is through doctors, medicines or the advanced technological capabilities of modern science. They never pause to think that it is Allah Who causes their physical system to function when they are in good health, or Who creates the healing medicines and doctors when they are ill. Many turn only to Allah when they arrive at the opinion that doctors and medicines are inadequate. People in such situations seek help only from Allah, realising that only He can free them from their difficulty. Allah has revealed this mindset in a verse:
When harm touches man, he calls on Us, lying on his side or sitting down or standing up. Then when We remove the harm from him he carries on as if he had never called on Us when the harm first touched him. In that way We make what they have done appear good to the profligate. (Qur'an, 10:12)