Southern Pacific Mars lights

Many SP diesels have the red mars light but what was it used for

First it wasn’t a Mars light it was a Pyle Gyralight. The difference being the Mars light swept in a sideways figure eight pattern (like an infinity symbol) and the Gyralight swept in a circular pattern. The red Gyralight on SP diesels tripped on automatically when the train went into emergency. It could also be operated manually from the cab.

An addendum. From trackside the Mars Light gives a pulse pulse pulse pulse
pulse pulse pulse pulse effect while the Gyralight is pulse pulse pulse pulse.
The best way to see the difference is w/ a tape or CD that shows the current 4449 (Gyralight) and one of the pre 1955 GS-4s (Mars)

Those lights were awesome…

Well the adendum made no sense due to the program eliminating spaces that it, in its GIGO wisdom, it considered extraneous. What I was trying to convey was that from trackside the Mars light gave periodic double flashes of brightness while the Gyralight put out single flashes

There were two purposes for the red oscilating headlight on SP locomotives.

First, it was an emergency stop indication for any opposing move on multiple track. Prior to radio, to give such a signal, the head man had to light a fusee and drop to the ground and then provide the hand signal for STOP. This way, the instand the train line separated, the emergency stop was provided for.

The second use of the “red Mars” was as a marker used when the locomotive was on the rear of a train (behind the caboose) or when running light. If no red light was available, the rear class lights had to be lit red - hard to see. If that was not available (and , now this is the current rule) the rear headlight must be illuminated on ROAD DIM.

From the GCOR rules, note 5.10.1, head light used as a rear marker, as Kenneo pointed out.

5.9.6 Displaying Oscillating White Headlight
If the leading engine is equipped with an oscillating white headlight, tum the light on when the engine is moving. However, turn the light off when meeting trains, passing trains, or during switching operations, unless movement involves public crossings at grade.

5.9.7 Displaying Oscillating or Flashing Red Light
If the leading engine is equipped with an oscillating or flashing red light, tum the light on under any of the following conditions:

Train is stopped suddenly where adjacent tracks may be fouled.
Head-end protection is required
or
Condition exists that endangers movement.
The red light signals an approaching train on the same or adjacent track to stop at once and to proceed only after the track is safe for train passage. Extinguish red flashing lights when they are no longer needed.
Displaying these lights does not modify the requirements of Rule 6.19 (Flag Protection) or Rule 6.23 (Emergency Stop or Severe Slack Action).

5.10.1 Highly Visible Markers
Display a highly visible marker at the rear of every train as follows:

From 1 hour before sunset to 1 hour after sunrise.
When weather conditions restrict visibility to less than 1/2 mile.

A marker equipped with a functioning photo-electric cell will automatically illuminate at the appropriate time.
When an engine is operating without cars or is at the rear of the train, the trailing headlight illuminated on dim may be used as a marker. Inspection of Marker

When a highly visible marker is required, a qualified employee must inspect it at the initial terminal and at each crew change point. To determine if the marker is functioning properly, the employee will inspect it by observation or by telemetry display in the cab of the engine. Th

The red light was known as a UDE or Undesired Emergency Light.
Thom