Such a mineral as magnesium is in whole grains, dark-green vegetables and nuts. Some patients suppose it has no effect during the migraine attack, but certain researches proved that it is also rather effective. You can take it in the form of pills, but consult your doctor before this. Refuse from sport if you have a headache, because it intensifies the attack. And if you feel well, systematic exercises avert headaches. They provoke endorphin release in the organism. These are the chemicals which cope with pain. They alleviate stress and guarantee you a sound sleep.