If your headlights are flashing off and on the circuit breaker in the switch is kicking on and off. Check the dimmer switch on the floor, after years of water and crud they stick and are often the cause of this. Otherwise it could be a turn signal bulb that has shorted out and is causing this. A good way to check is put your brakes on and see if any turn signal bulbs light up in front. If they do, then your problem is in the rear bulbs.