probably a poor earth or loose connection,may be worth running length of wire from the earth on the bulb holder back to some bare metal on the frame or the neg terminal on the battery i presume its neg earth ? check all the connection are free from corrosion and also the switch