Light passing by a massive object will be deflected by the object's gravity. The effect is very small, so you need something very massive, like a star, or better still, a black hole to get a noticable deflection. The usual result of such a deflection is that the background object is displaced a small amount from its true position. However, if the foreground object (the "lens") and the background object are nearly colinear with the observer, more exotic effects, such as high magnification and multiple imaging, are possible.

A number of practical uses have been found for lensing. Faint objects like brown dwarfs and white dwarfs in our galactic are too dim to detect directly, but occasionally they pass directly in front of a background star, causing it to brighten for a day or so. By monitoring a large number of stars and counting the number of microlensing events, astronomers can get an idea of how many faint compact objects there are in our galaxy's halo.

Galaxy clusters also can act as lenses. Observations of the distortion of background galaxies produced by the cluster can be used to reconstruct the details of the mass distribution in the cluster.