Just to clarify the issue.....are you saying that with your lights switched off,the brake light works....but when you switch your lights on,the tail light works.....but the brake light doesn`t ?
AS Tarka said............one bulb does two functions with two filaments, tail lamp and stop lamp. It sounds like the tail lamp filament has blown, get a new one, ask for a '12 volt stop and tail bulb' from any garage etc. about 60p.