A bit more detail
This effect relies on Einstein's theory of general relativity. Astronomers use it to detect dark or dim objects that emit no light of their own, such as rogue planets and black holes. The duration of the brightening helps researchers estimate the mass of the passing body.