3 series brake light assemblies are notorious for getting dirt, water, and everything else back in there. BMW has a totally bizzare way of supplying power to the bulbs. Couple that with bad gaskets and over time it opens up all types of problems.
One of the easiest fixes is to replace the whole assembly. It comes out really easy, three nuts, tops, and it just pops out. The nuts are on the inside. Don't ebay 'em like i did because the pin connections are different from the plug connections on different years and different model number 3 series. They all look the same but they wont plug in.
There is a circuit looking board supplying a positive and ground to each bulb in each assembly. it's not worth trying to troubleshoot. just replace. there's a whole lot of aftermarket stuff out there.