Most modern railways use continuous welded rail (CWR), sometimes referred to as ribbon rails. In this form of track, the rails are welded together by utilising flash butt welding to form one continuous rail that may be several kilometres long. Because there are few joints, this form of track is very strong, gives a smooth ride, and needs less maintenance; trains can travel on it at higher speeds and with less friction. Welded rails are more expensive to lay than jointed tracks, but have much lower maintenance costs. The first welded track was used in Germany in 1924 and the US in 1930 and has become common on main lines since the 1950s.
The preferred process of flash butt welding involves an automated track-laying machine running a strong electrical current through the touching ends of two unjoined pieces of rail. The ends become white hot due to electrical resistance and are then pressed together forming a strong weld. Thermite welding is used to repair or splice together existing CWR segments. This is a manual process requiring a reaction crucible and form to contain the molten iron. Thermite-bonded joints are seen as less reliable and more prone to fracture or break.
If not restrained, rails would lengthen in hot weather and shrink in cold weather. To provide this restraint, the rail is prevented from moving in relation to the sleeper by use of clips or anchors. Attention needs to be paid to compacting the ballast effectively, including under, between, and at the ends of the sleepers, to prevent the sleepers from moving. Anchors are more common for wooden sleepers, whereas most concrete or steel sleepers are fastened to the rail by special clips that resist longitudinal movement of the rail. There is no theoretical limit to how long a welded rail can be. However, if longitudinal and lateral restraint are insufficient, the track could become distorted in hot weather and cause a derailment. Distortion due to heat expansion is known in North America as sun kink, and elsewhere as buckling. In extreme hot weather special inspections are required to monitor sections of track known to be problematic.
After new segments of rail are laid, or defective rails replaced (welded-in), the rails can be artificially stressed if the temperature of the rail during laying is cooler than what is desired. The stressing process involves either heating the rails causing them to expand, or stretching the rails with hydraulic equipment. They are then fastened (clipped) to the sleepers in their expanded form. This process ensures that the rail will not expand much further in subsequent hot weather. In cold weather the rails try to contract, but because they are firmly fastened, cannot do so. In effect, stressed rails are a bit like a piece of stretched elastic firmly fastened down.
CWR rail is laid (including fastening) at a temperature roughly midway between the extremes experienced at that location. (This is known as the "rail neutral temperature"). This installation procedure is intended to prevent tracks from buckling in summer heat or pulling apart in winter cold. In North America, because broken rails (known as a pull-apart) are typically detected by interruption of the current in the signaling system, they are seen as less of a potential hazard than undetected heat kinks.
Joints are used in continuous welded rail when necessary, usually for signal circuit gaps. Instead of a joint that passes straight across the rail, the two rail ends are sometimes cut at an angle to give a smoother transition. In extreme cases, such as at the end of long bridges, a breather switch (referred to in North America and Britain as an expansion joint) gives a smooth path for the wheels while allowing the end of one rail to expand relative to the next rail.