Cameras lenses are made of pretty tough glass, but a strong knock can still do some damage. Because lenses are curved, the scratch is usually only in one particular place and almost always small. Most scratches will affect your picture quality very little, which is good news because scratches are difficult to fix.
Polish the lens with a lens cloth and take a picture with the camera. If you are using a film camera, have the photo developed.
Look at the photo carefully to see if the lens damage affected the image. If you see glare or fuzziness on one particular section of the image, the scratch has probably affected the lens and you should continue to step 3. Otherwise, you don't have to do anything to fix the lens.
Take a thin permanent marker and carefully fill in the scratch with ink.
Immediately wipe off any excess ink with a lens cloth. Look at the lens to make sure there is no ink outside of the scratch.
Take a few more pictures. The black ink will stop the scratch from introducing glare and will probably fix any problems with the image.
Consider getting a new lens or putting up with the defect if the image still looks flawed. Many camera lenses have delicate coatings applied to them, so trying to polish out the damage with an abrasive will most likely just rub off the coating and make the problem worse.
If you are worried about scratching your lens, put a lens hood on your camera. If you do drop it or bump into something, the hood will take the impact, sparing the lens.