When I watch a horror film, the emotions of anxiousness and excitement gives me a headache. Why does this happen? What can I do?

Horror headache. Most likely your BP and heart rate go up due to being scared. You get the flight or fight reaction and state. Google this and see. Understanding it will help. You can stop watching these movies is likely best treatment.