Try orange juice.
I get hasseled by these headaches and migraines quite a bit.
Everytime I fly I always bring with me tablets, but once I forgot them and I got one killer headache. The cabin crew gave me lots of orange juice. Not the cheap stuff but real hearty with the pulp and everything. To my astonishment it really worked!! So give it a go in an emergency.