More than likely you have a headlight relay sticking on. The relay packs are usually under the hood near the battery with the fuses. When you pull of the fuse cover sometimes they are labeled under the lid. If it shows a L and R headlamp relay, tap on it when you are having that problem and see if it turns off. If it doesn't, pull the relay out and the light should turn off. If this is the case, go to your local auto parts store and buy another one. Shouldn't be much money.
If you don't see the relays there, check your owners manual. In the index it should list the fuse and relay locations.
If you don't see the relays there, check your owners manual. In the index it should list the fuse and relay locations.