A masthead float goes at the head of the mainsail and stops the boat totally inverting when it capsizes. This can be useful for younger sailors who can be worried about getting trapped under a boat as it inverts and lack the weight to right a boat with the mast and sail below the water.
Itchenor Sailing Club use them with their very successful Junior beginners program and have have written their use into the under 12 yrs race Sailing Instructions.
This is the one used at Itchenor. The loops fix on to the main halyard and the white section wraps around the bolt rope. They work on Gunter (gaff) and Bermuda rigs. They are made by Optiparts - part number EX2600. You can get them from IBI Sailing or Pinnell & Bax (but not on their website when I looked in 2012).
Other designs of float are available, here is a Crewsaver one sold by Trident-UK.