Have you checked your blood pressure? Your head ache could be caused due to a high blood pressure. It could also be an simple muscle spasm, in that case a anti inflammatory should work. Don't panic. Use a pain killer when you experience pain. See if you have neck pain during those episodes. If you have any further doubts please feel free to ask.
Next Steps
If you have neck pain, get a xray neck done.
Health Tips
In case of Vomiting, visual disturbance please see a neurologist.