The rails of a post and rail fence are the horizontal members that attach to the posts by fitting into or against them. According to Better Homes and Gardens, you can attach them in four main ways. Unless otherwise stated, use Phillips or slotted, flat head, countersunk, gauge 4 or 6 wood screws that are weather-resistant. These include galvanised screws, which are zinc-covered, stainless steel and brass screws.
A housing joint for a fence is made up of a groove cut into the front or back face of the post, to the height, and optionally depth, of your rail, that your rail sits in, either fully or partly. Use screws that are 50 per cent longer than the width of your rail. For example, for a 2-inch-wide rail, use 3-inch-long screws.
A block joint is where you nail or screw small blocks of wood to the sides of the posts, then nail or screw your rails on top of the blocks. If you screw your rails vertically into your blocks, they need to be longer than the height of your rails but no longer than the combined height of rail and block. If you screw your rails through your blocks at an angle and into the posts, use longer screws.
A butt joint is where you simply fix the rails between the posts by nailing or screwing through the rails at an angle into the posts. It is the weakest way to attach your rails to your posts. Thin screws are better for a butt joint, as thicker screws can split the end of the rail. Use gauge 3 instead of gauge 4 or 6.
Mortise and Tenon Joint
For a mortise and tenon joint, you cut a slot in the post called a mortise and cut a tenon on the end of your rail to fit into it. Exterior mortise and tenon joints are often pegged rather than nailed or screwed. In other words, you screw a hole through the joint and insert a cylindrical rod called a peg. However, if you prefer to screw your mortise and tenon joint, use a screw no longer than the width of your post.