A lens forms an image by refracting light. In a convex lens, parallel rays of light are brought to a focus at the principal focus. The distance from the lens to the principal focus is called the focal length. Ray diagrams are used to show the formation of images by convex and concave lenses.