Remove the rotted railing. Wear safety glasses and gloves for this project. If the railing is nailed on to the supports, insert a prybar underneath the rail and lever upwards to pop it off. If it is screwed in, use a drill, reverse the direction and remove the screws. Dispose of the rotted wood.
Measure the space for the railing. Get the exact length needed for the new railing. Use a measuring tape and measure the spot twice. Write down your measurements.
Cut the new board to fit. Use a circular saw (always keep your fingers away from the blade and use the blade guide) and slowly feed the board through the saw.
Attach the new board to the railing supports. Screwing down a railing is much more secure than using nails. Remove the old nails if they are still in the supports. Use your drill (move it back to the regular position) and insert your first screw through the center of the board. Add two more screws for a secure fit. Repeat on the other side of the board.
Seal the wood. If you will be staining the wood, use an exterior, oil-based wood stain. Apply as many coats as necessary, sanding in between and then seal the entire board with a coat of clear polyurethane. If you will be painting the railing, prime it first with an exterior, oil-based primer and let it dry. Apply at least one coat of exterior, oil-based paint over the primer.