A few excerpts:
Studies by the airlines and ground-based medical support services have found that a health care provider is available and responds in upwards of 80 percent of in-flight medical events. The truth is, though, that many health care providers find themselves attending to issues they don't see in their medical practices, and most have no specialist knowledge about aviation medicine or the medical resources aboard the plane. If asked, many health care providers will volunteer to help, especially if no one else is available, and this can lead to problems...I've never been asked to respond to a medical emergency while flying. But my brother (also a physician) has, and he said it was a bit nerve-wracking having to decide whether or not to divert the plane to the nearest airport.
In addition to the goodwill of travelling physicians, all the major carriers in the U.S. have, for at least the past decade, also relied on ground-based physicians and nurses with experience in emergency care and additional training in aviation medicine. Based at centers including MedAire in Phoenix, the University of Pittsburgh Medical Center's STAT-MD program, the Mayo Clinic Aerospace Medicine program, and sometimes an airline's internal medical department, these experts work with the flight crew and volunteer health care providers on board over radio or satellite telephone to assess and stabilize sick passengers, to guide the decision whether to divert the airplane, and to organize the medical response on the ground...
According to Dr. Claude Thibeault, medical advisor to the IATA, "If you are caught in a medical emergency on-board, the first thing you should do is to ask if the airline has access to ground medical support. If so, then ask the flight attendant to call them immediately."
(Read the full text of "Medical Emergencies at 40,000 Feet".)