Earthing problem I'd guess. When the brake lights are switched on there's not a good earth return. Start at the rear lights and check the earth connections.
Have you recently changed any of the rear bulbs? If so, have you mistakenly fitted single filament bulbs where there should be actually twin filament bulbs? Or maybe the two contacts in the base of the bulb holder are touching one another.