on my mondeo it was the bracket near the brake pedal which holds the switch for the brake lights, the bracket had slightly bent away from the pedal. very simple fix.
otherwise check your earths to the rear lights, wiring to the brake pedal switch etc