“Although marijuana is principally used as a psychoactive substance, it has also been used for medical and religious purposes for over 2000 years.
This review concluded that there was evidence of a positive and moderate short-term trend toward a reduction of pain.
There are a number of reasons why naturally occurring cannabis or cannabinoid drugs might have a pharmacologic effect on headache..
It has been suggested that one explanation for migraine and other headache disorders may be an underlying endocannabinoid deficiency.
…cluster headache attacks were relieved within 5 minutes by the inhalation of marijuana.
Subsequent treatment with dronabinol (THC) 5 mg orally also provided the patient relief within 15 minutes.”
http://www.medscape.com/viewarticle/738529_2
http://www.thctotalhealthcare.com/category/headachemigraine/