For example, due to the gravity of a black hole.

Answer
Dear Martin,
actually you can’t say that light is bent. Due to the presence of a heavy mass, space itself becomes curved. The shortest path between two points is then no longer a strictly straight line. Light always tries to follow the shortest path, and if it is slightly curved, the photons just go with it.
Near a black hole, the deflection can be enormous, but an ordinary star such as our sun also warps space in its vicinity, in a minute but measurable way. This can be observed by measuring the positions of stars adjacent to the solar disk during a total solar eclipse and comparing them to where they should be if we are not looking closely at such a star. It turns out that the deflection allows us to see a bit around the sun, as you can see on the attached figure (Nasa). The deflection was first measured in 1919 by Eddington. The value he obtained was within the expected measurement error, compared to the value of 1.75 (ie 1.75 arcsecond) predicted by general relativity.
Answered by
prof.dr. Paul Hellings
Department of Mathematics, Fac. IIW, KU Leuven
Old Market 13 3000 Leuven
https://www.kuleuven.be/
.