I just had my first experience with altitude, teaching in Colorado. The actual town I was teaching in wasn't too bad at 6700 ft, but traveling from Denver I could definitely tell a difference when I went over the Continental Divide!

Like OM said, the basic problem is increased pressure because your brain swells, either because you're sending moe blood there or because cells are dying and releasing fluid. In either case, you wind up with more stuff in a fixed space, and the result is increased pressure. It manifests as headache, nausea/vomiting, that sort of thing. Should you or one of your party develop ataxia (stumbling gait, similar to being a little tipsy) or some sort of altered mental status, GET DOWN! You've entered the realm of HACE, and while an injected steroid like dexamethasone might buy you some time to walk down, the only treatment is to descend, and fast.

OM pretty much nailed the treatment. Diamox can be used to prevent AMS, along with hydration and nutrition. Ibuprofen or Tylenol can symptomatically treat the headache. But bottom line, if you develop AMS, you've gone up too far to fast. Take a rest day, descend, or both, but don't go any higher until your symptoms resolve.