A fife rail is a design element of a European-style sailing ship used to belay the ship's halyards at the base of a mast. When surrounding a mast, a fife rail is sometimes referred to specifically by the name of the mast with which it is associated: the main fife rail surrounds the main mast; the mizzen fife rail surrounds the mizzen mast, etc. It is one of a dozen or so types of "rails" often found on such ships. Fife rails are typically horizontal strips of either wood or iron and are joined and fitted to the tops of a series of stanchions. The term apparently derives from the location where the ship's fifer would sit and play his fife at heaving of the ship's anchor.
A fife rail surrounding a ship's mast will contain a series of belaying pins corresponding to the sails on that mast which they belay. A mast will either have a single horseshoe-shaped fife rail surround the base of the mast on the fore, starboard, and port sides, a single straight rail directly before or directly behind the mast, or a set of two fife rails, one on each side (fore and aft) of the mast.
Each sail associated with a given fife rail will have several corresponding belaying pins set into that rail.
Although a fife rail is a kind of pin rail, the term "pin rail" is often used to specifically denote those rails containing belaying pins that are attached to the hull. Unlike these, fife rails are freestanding.