Sunscreens block or absorb ultraviolet light, but they must be chosen and applied correctly. To understand them properly, you need to know what the term SPF stands for and what it means.
All sunscreens carry a sun protection factor, or SPF. The SPF is essentially a multiplying factor. If you would normally be safe in the sun for 10 minutes and you apply an SPF 10 sunscreen, you can stay in the sun safely for 100 minutes.
For the sunscreen to be effective, you have to apply plenty and it has to stay on. You should apply it about half an hour before going out in the sun (or the water), to give it time to bind to your skin.
Remember that only sunscreens with an SPF higher than 15 will protect you from both UVA and UVB rays.