Altitude sickness can take three basic forms: acute mountain sickness, high-altitude pulmonary edema and high-altitude cerebral edema. All are related to the thinner air found at high elevations. As you ascend, there's less oxygen in the atmosphere and your lungs can't take in as much as they're used to. That's why you have to ascend to high altitudes gradually -- to let your body adjust.
High-altitude cerebral edema is the rarest of the three types of altitude sickness, but it's also the most dangerous. In high-altitude cerebral edema, your brain swells due to retained fluids and the diminished oxygen reaching it. Signs of high-altitude cerebral edema are confusion, disorientation, bad headaches, vomiting, seizures, a sense of imbalance that causes difficulty walking and coma. People who ascend from lower elevations to higher ones too quickly are more at risk for high-altitude cerebral edema than those who take it slowly and wait for signs of acute mountain sickness to pass. People with pre-existing heart or lung conditions are also at a higher risk for high-altitude cerebral edema than those who are healthy. Plus, if you already contracted high-altitude pulmonary edema, your chances of high-altitude cerebral edema grow.
The first step to handling high-altitude cerebral edema is immediate descent to a lower altitude. Treatment for high-altitude cerebral edema includes oxygen supplements and administration of dexamethasone to reduce the swelling of the brain. Some people need a type of hyperbaric chamber to increase the air pressure surrounding them. To prevent altitude sickness, you have to climb gradually, making sure not to increase the elevation you sleep at by more than a thousand feet (300 meters) each day. If you feel any signs of mountain sickness -- like headaches, nausea, fatigue, difficulty sleeping, shortness of breath or swelling -- you need to stop your ascent until all of the symptoms go away, even if it takes days.