Have you checked the cradle that the bulb clips into? The metal contacts can get corroded, giving a poor connection. If so, clean it with some sandpaper. If it's alright though, it's likely to be a wiring fault, possibly a broken wire after the headlight relay.
John
March 2008