That sounds like an earthing issue. Either where the body of the tail light bolts on to the car, or a single wire out from the harness screwed to the vehicle body near the tail light. Probably just need to scratch the contact area with a screwdriver or similar, also check bulb holder isn't wet or rusty.

cheers
Max