On the less conventional side (and what drove me nuts for a couple of weeks), the same can happen with an intermittant short. In my case, the taillight harness was rubbing against one of the taillight bezel studs, when it contacted, it would short and pull the voltage down, and the headlights would dim.
One way to help track the issue is to watch the voltage (like with a voltmeter), if its not dropping or fluctuating when the lights are off, that would help rule out the voltage regulator. If it only fluctuates when the headlights are on, I'd start looking for a wire with the insulation worn off.
Carl