A roof is the crowning element of every house. Most roofs have as their crowning element a ridge board, which ties the rafters together. Only flat, shed or single-pitch and pyramid roofs do not have a ridge board at a peak. The ridge is most pronounced on gable roofs, which slope to two sides, but it's also there on hip roofs, at a peak before the hip ends start, or a gambrel, which slopes to two sides but in two or three steps. A gable roof ridge board must run from one end of the house to the other.
Make sure the ridge board is the same dimension as the rafters or the rafter element of the roof truss. That normally will be 2-by-4-inch or 2-by-6-inch board. The ridge board sits in slots atop prefabricated trusses or between the ends of rafters on each side, which must be nailed to it to hold the roof frame together.
Measure the total roof length and the length of the existing ridge board. Most roofs will be too long to be spanned by a single board. Measure how much gap needs to be covered by a ridge board. If there is a 24-foot roof and a 20-foot ridge board, 4 feet need to be covered. Count how many rafters are uncovered.
Splice two boards to make a ridge board that all rafters rest firmly against. Don't splice just at the end of a ridge board that's 2 or 4 feet short. Cut ridge boards of equal length to fit between the end rafters. Make the splice between rafters, so each ridge board rests firmly on a rafter. Cut sections of matching board, 2-by-4 or 2-by-6, to span about a foot on each side of the joint where ridge boards meet. Nail those splices on each side of the ridge board joint. Make sure the splice is solid and the spliced boards are level, then nail all rafters to the ridge board.