There are about a thousand drugs that you can take, and some will promote positive results while others promote negative results. The problem is that most of them are inconsistent for results.

My experience from 10,000 to 20,000 feet is that about 80% of the headache problems come from simple dehydration. The best way to avoid AMS is to sleep at moderately high elevation for two or three nights immediately prior, and to get some moderate exercise during those days. All you are trying to do is to get the short-term respiration adaptations to kick in.