A machine, such as a coordinate measuring machine, having an element and a structure movable with respect to each other along rails, wherein the rails have a different coefficient of thermal expansion than the structure to which they are attached. In one embodiment, a bar is disposed on the structure opposite the rails. This bar has a coefficient of thermal expansion, a stiffness, a spacing from the neutral axis of the structure, and a cross-sectional dimension such that the bar balances any thermal stresses in the structure caused by differential expansion or contraction of the structure and the rails with temperature changes to minimize any bending of the structure. In one embodiment, two rails are disposed on a beam, and a carriage travels on the two rails. For each rail, there is an associated bar disposed on an opposite surface of the beam. In another aspect, a pin extends into an elongated slot on a slide associated with the structure to allow the structure to expand and contact. In yet another aspect, a movable element, such as a carriage, is coupled to an associated slide riding along the rails by a leaf spring to accommodate expansion and contraction of the element.