Light travels in straight lines due to a fundamental property known as the rectilinear propagation of light. This principle is based on the fact that light travels in the form of electromagnetic waves, which obey the laws of geometric optics. According to these laws, when light passes through a homogeneous medium or free space (in the absence of any external influences), it travels in a straight line.
However, in the presence of gravity or other gravitational fields, the concept of "straight" becomes more nuanced. In general relativity, which describes the behavior of gravity, spacetime is curved in the presence of mass and energy. When light passes through this curved spacetime, its path appears to bend due to the influence of gravity.
This bending of light by gravity is known as gravitational lensing. Massive objects, such as stars, galaxies, or even entire clusters of galaxies, can curve the surrounding spacetime. As a result, light passing near these massive objects follows a curved path. This phenomenon has been observed and confirmed through various astronomical observations.
The amount of bending depends on the mass and distribution of matter causing the gravitational field. Strong gravitational fields, such as those near black holes or in the vicinity of massive galaxy clusters, can cause significant distortion of light paths. This effect can lead to the magnification, distortion, or multiple images of distant objects, as mentioned earlier.
So, in the context of space distorted by gravity, the straight path of light is modified due to the curvature of spacetime caused by the presence of massive objects. Light follows the curvature of spacetime, resulting in its apparent deviation from a straight line when observed from our usual Euclidean perspective.