Altitude sickness (AMS, HAPE, and HACE) all stem from hypoxic injury to cells. If cells don't get enough oxygen they swell and eventually leak fluid, which is the source of the symptoms of AMS (mild cerebral edema from brain matter swelling), HAPE (fluids in the lungs from leaking pulmonary cells) and HACE (severe cerebral edma). Since oxygen molecules stretch farther and farther apart the higher the altitude, you breathe more rapidly and your heart works harder and harder to circulate enough oxygen to your tissues. When your cardiovascular system can no longer keep up, the hypoxic injury starts. Therefore, aerobic fitness is important to minimizing altitude effects; the more efficiently your system can deliver oxygen to your tissues, the more "wiggle room" you have in terms of altitude before your body starts to lag behind. Past that, it becomes a matter of pacing yourself, and as somebody said before, not getting your body in a "catchup" mode for as long as possible.

Somebody mentioned Diamox earlier and thought it was acetamenophen; the generic name is acetazolamide. It's a diuretic that helps the body get rid of bicarbonate via urination to help prevent sleep hypoxia and sleep apnea at altitude.

(Sorry, been studying for my flight paramedic exam and the topic was altitude today!)