You need to see a doctor, that sounds like a health problem to me. The sudden onset of lucid dreams every night could be related to your condition. Whenever I go straight from being awake to entering a dream, I usually wake up after the dream very rested and relaxed, so I doubt it's the heightened mental activity from lucidity that's causing your headaches.