does it happen with only low beam, high beam or both? does it affect any other lights, like tail or dash? I'd guess a poor connection somewhere that's oxidized ... check all the plugs in the circuit along the way from power to the lights, including the plugs on the back of the bulbs - could also be something in the alternator that's momentarily dropping the current output, like a sticky regulation circuit
Bill