This is just for reference as I just struggled through this problem and found many posts helpful but couldn't reply because they are older threads. But I wanted to post the resolution for reference for someone else.
Problem: 1993 Volvo 240 Sedan with all lights working except brake lights (including third brake light in back window). Fuses ok (changed twice). Bulbs ok (tried many). Power through brake switch (the one way up above the switch for the cruise control). Had checked power to back flexible circuit board and power to the white plastic connectors was coming in only to parking, flashers, and fog lights. So it seemed the board was OK with the problem between the pedal switch and the connector in the back (sedan).
Pulled off the hard plastic near your knees (pull out plastic tabs and remove to star screws and then bring down and out). Reached up and pulled the black and red bulb failure sensor (~ 3 inches long and ~
1.5 inces diameter) down from the clip that holds it. It comes apart (the black and red part but it was difficult.As others posted, tested lead #54 by slipping in the voltage meter probe. Getting voltage in on #54 meant (I think) that power was coming in from the brake switch when the pedal was pressed. That is how I ruled out the brake pedal switch - it was easier to get to the senor then the switch. So then I kept the pedal down and checked the two out-going leads (#54L and #54R) and there was nothing on the meter.
I replaced the sensor with a $127 (late on a Saturday - no time for price checking) one from the volvo dealer and it all worked!
Hope this helps....