This has been talked about ad nauseum on this forum. You should browse for lots of discussions/sugestions on the subject.
One on the most common causes of extreme headaches on the Master-Cleanse is caffeine withdrawal. The best way to diminish the detox symptoms is by eating a real clean diet with no porcessed foods. sugar, meat, dairy etc and eat mostly raw fruits and veggies and veggie juicea week before starting the MC. Of course if you're a caffiend then you'll want to wean off that.
The best way I know to ease the headaches or any other detox symtoms while on the Master-Cleanse is by drinking lots of water and lemonade on the onset to help dilute the toxins and get them out of your system. Several folks have commented that they have done enemas during a detox/healing crisis with great success relieving the symptoms. Mr Burroughs is pretty dead set against enemas but compared to taking some kinda toxic headache chemical crap it is definetly the better alternative.