You say you think the helmet fits well, but it doesn't sound like it.
What part of your head is the headache in? What motorcycle helmet fits you best?
The last time I tried on a Lazer helmet it was VERY short from front to back. I have a "Shoei head," what Arai calls a "long oval," and there's no way I could have worn that Lazer. Giro helmets are similarly shaped but not quite as extreme. I am wearing a Specialized helmet now and the fit isn't too bad.
ETA: you mentioned heat and hydration as a possible contributor, are you making sure to replace electrolytes?
Speed comes from what you put behind you. - Judi Ketteler