Fray Check is a USA product which can be purchased in the fabric/craft department of most superstores or at any fabric store. A little bit does the trick. Spotlight (NZ and Australia) has a product called Fray Stopper which comes in a 50ml bottle. Current price NZ$5.99.
Clear nail polish can be used to seal ribbon ends and keep them from fraying.
Heat sealing is another method you can use to finish your ribbon ends. Use a candle, match, or lighter and hold the flame close to the ribbon end to achieve an evenly fused end. Do not actually touch the flame to the material.
Sold by Ribbons and Bows Oh My! here.
Many people have also found much success using a wood-burning tool to seal ends. In this case, you could lay the ribbon flat on a heat-resistant surface, use a metal ruler to mark your line and run the tip of the tool against the ruler edge.
When applying satin ribbon to a garment, the friction of wash and wear tends to cause folded ends to start a surface fraying if they have not been machine stitched.
The above example shows ribbon that is folded over the placket and stitched into the seam inside the garment. After only two launderings, the fold had produced this unsightly fuzz.
This example shows ribbon that had been stitched along its edges, but the fold of the tucked-under ends was left unstitched. The fold quickly produced a surface fray which has now been prevented from further damage by machine top-stitching, as below.