Usually the result of a poor (high resistance) connection at the headlight switch! Have the switch and the wire connector to the switch checked for signs of excessive heat, melted or deformed connector plug. If that is found the switch and connector needs to be replaced. Are the headlight bulbs original equipment type, number and candlepower, as far as you know? No high output or higher wattage bulbs installed?