If you get really bad headaches from it, maybe you shouldnt be smoking weed. A lot of people just cant handle weed for one reason or another, its quite common. Could you possibly obtain some hash or wax or other type of concentrate? If you dont react harshly to the concentrate, Id imagine your headaches are an effect from smoking the plant matter. The downside to this is, hash will get you higher and might possibly cause an even bigger headache.
Either that, or if you plan to get high, stay high the rest of the day with "maintenance puffs" or something. Also try another method of use like an edible, or Aporizer, and see if these headaches dont disappear.