The lap joint is the simplest joint used to fix fence rails to fence posts. With the lap joint, the rail is held flat against the vertical post, then nailed or screwed into place to attach it. Screwing the rails to posts takes longer, but screws give a stronger and longer-lasting hold than nails. Always make sure that nails and screws used to fix fence rails are non-corrosive because they will be exposed to the weather. Galvanized nails and screws do not corrode, and brass screws are also resistant to weathering.
With a mortised joint, a hole is made in the fence post that exactly matches the shape and size of the end of the rail. The rail is then inserted into the hole. If the rail is long enough, it can be slotted all the way through the post, until it reaches the next post. The ends of two consecutive rails can meet in the center of a hole made in a vertical post. You should treat the rails, and the wood around the hole in the post, with a water-resistant wood treatment product because rain water will be attracted into the gap between the rail and the post. This is where the fence is at most risk of rotting.
Grooved joints are the most difficult joints to create. With a grooved joint, a groove is cut in the outside of the post, that exactly matches the height and depth of the rail. When the rail is placed in the groove, the face of the rail and the face of the post form one flat surface. As with the mortised joint, you should treat the wood inside the groove with a weatherproof timber treatment because water will lie in the space between the grooved timber and the rail. Once the rail is slotted into the groove, you should fasten it to the post using galvanized or brass screws.