The yards are the cross pieces from which the square sails are hung. Each of the 3 vertical masts has 3 yards, plus an extra one that could be raised when required. They are named after the section of mast that supports it. On the main mast this means that they are called (from bottom to top): main yard, main topsail yard, main topgallant yard. The extra yard is called the main royal yard. Added to this the bottom 2 yards on the main and foremast are extendable. These are called the yard arms and were used to raise extra sails. The bowsprit (found at the bow or front of the ship) also has 2 yards. These are the spritsail yard and the sprit topsail yard.
Where the top masts are attached the lower 'mast' is a platform called the 'top'. The 'tops' had various functions: they spread the standing rigging which helped keep the mast upright; the sailors could use it as a rest area in between working the sails; during battle sailors and Royal Marines could fire muskets and throw grenades from the tops. It was from the mizzen top of the French ship, the Redoutable, that the musket ball which killed Nelson was fired.