I suspect you mean sometimes the brake lights don't turn on when they should. The best way to approach this is to use a test light and measure right on the wires on the brake light switch. The turn signals are not involved with the brake lights so we can rule out a defective signal switch. That leaves the brake light switch and the wire going to the rear of the truck. The clue is if the brake light switch has intermittent contacts, the cruise control won't kick out when you tap the brake pedal.
To verify the switch is defective, you have to get it to act up and stay that way so you can do the tests. You can place a stick between the brake pedal and the seat to keep the switch turned on once you get it to act up. With the test light or a digital voltmeter, you should find 12 volts all the time on the light green / red wire. If that's missing, we'll have to work our way back to the fuse box and check for a loose or corroded fuse. Next, you should find 12 volts on the light green wire when you press the brake pedal. If you don't have it there but you do on the light green / red wire when the pedal is pressed, the switch must be replaced. If you DO find 12 volts on both wires but the brake lights don't light up, there is an intermittent break in the wire going to the rear.
We can rule out the ground wires if the center brake light also doesn't turn on because that one has its own separate ground. If the center brake light does work, the grounds still are not a good suspect. Both the left and right brake light grounds are tied together, but they are tied in with the signal bulbs too. That means a ground issue would also affect the signals.
If the center brake light does work all the time, a real good suspect is someone added a trailer wiring harness by splicing the wires in with "Scotch Lok" connectors. Those don't seal out moisture and corroded wires can be expected.
Friday, June 19th, 2015 AT 8:48 PM