A stock rail is a fixed component in a track switch, with other rails moving around and against the stock rail to direct trains along various tracks. The moving parts are known as point blades or switch rails, depending on regional preferences. All of the components at a track switch are carefully selected and maintained to make sure they will be able to withstand the weight of passing trains that may be moving at various rates of speed.
When looking at a section of track where a switch is present, the stock rail is usually easy to identify. It will be the unbroken, straight or curved rail, usually on the outside, although some designs are different. The switch rails have tapered points and are clearly designed to move, allowing them to butt up against the stock rail or to pull away from it, depending on how the switch is set. Switches represent a point of vulnerability on the track, as there is an increased risk of derailing when trains are passing over the switch, and the setup is carefully inspected on a regular basis for signs of problems.
An operator can flip a switch at that point in the track or operate it remotely to control the direction of trains. Some switches are simple, allowing for a choice between going straight or taking a curved track to another location by moving the switch rail against one stock rail or another. Others are more complicated and can include joints for multiple sets of rails, directing trains to a variety of places.
In cold climates, the area under the switch may be heated in the winter to make sure the mechanism remains free of ice and snow. The switch can also be located in a covered or enclosed area. Railroad workers will routinely inspect the stock and switch rails to make sure they are in good working order, enacting repairs as needed. As the fixed rail, the stock rail doesn't move when the switch is activated, and tends to be less prone to breakdown and other problems as a result.
Track switches are usually locked to avoid problems such as passersby maliciously or accidentally activating them and causing a derailment or other problem. Personnel in charge of managing the track monitor the passage of trains and can operate switches to shunt them to different locations, order them to stop for safety reasons, and take other measures to keep conditions safe and functional.