Two things have happened to your fence assembly. First, there has been movement along your fence line and has caused the fence rails to pop out. The second thing that has happened is that the fence rails have shrunk due to age and exposure. Adding more timber to the old one will not be productive as it will simply break apart.
I recommend measuring the new distance between posts and replacing both the timber rails of your fence. It will be necessary to remove the palings from the olde fence and transfer them to the new ones.
However, if you are currently not prepared to replace the rails, I suggest looking carefully at your old fence rails and try to determine which part is still solid and which part has rotted away. You can easily tell by pinching the timber, if it gives way, bows or crumbles then this part must be cut away. If you are putting in a repair piece, just make sure that it is still solid wood and that it can take weight.
I recommend measuring the size of your fence rail and getting the same size at the store. You can join them together using a galvanised nut and bolt assembly.
Please make sure to wear personal protection such as gloves, goggles and a dust mask when working on your fence.
Let me call on our experienced members @Adam_W and @TedBear for their recommendations.
If you need further assistance, please let us know.