Prime the rail. Paint, stain or varnish both sides of the rail before installing it. If you plan to finish the trim after it is nailed on, apply a coat of finish to the back now.
Draw a layout line. Determine the height of the rail. Mark the wall at that height, and use level to extend a horizontal line for the top edge of the rail.
Make miter cuts at corners with a power miter saw. Moldings with simple profiles can meet at 45-degree miter joints for both inside and outside corners.
Make square cuts at door and window casings. If the molding is thicker than the casings, make a transition by cutting a bevel on the portion that protrudes.
Nail the chair rail. Locate the studs with a stud finder or by tapping a nail through the wall where the holes will be concealed by the trim. Hold the chair rail in place and transfer the stud locations to the rail.
Drill pilot holes at each mark and attach the molding with finishing nails. Countersink the nails, putty the holes, and smooth the outside corners by sanding the exposed edges.