Light travels in straight lines due to its behavior as an electromagnetic wave and the principle known as the "law of rectilinear propagation." According to this principle, light travels in a straight path through a homogeneous and transparent medium unless it encounters an obstacle or interacts with another material or field.
In the absence of any external influences, light continues to propagate along a straight line because it does not experience any forces that would cause it to deviate from its path. This straight-line propagation is a fundamental property of light and is based on the wave nature of electromagnetic radiation.
However, in the presence of gravitational fields, such as those created by massive objects like stars, planets, or black holes, the path of light can be influenced or curved. According to Einstein's theory of general relativity, gravity can bend the fabric of spacetime itself, causing light to follow a curved path as it passes through the curved spacetime near massive objects. This phenomenon is known as gravitational lensing.
In the vicinity of extremely massive objects like black holes, where gravitational forces are extremely strong, light can be significantly distorted and follow curved trajectories. This effect has been observed and confirmed through astronomical observations, where the light from distant objects appears to be bent or deflected due to the gravitational fields of intervening massive objects.
So, while light typically travels straight in the absence of any gravitational or external influences, its path can be curved or distorted in the presence of significant gravitational fields.