Light does bend when it passes through different mediums due to a phenomenon called refraction. However, in a vacuum where there is no medium to interact with, light propagates in a straight line without bending.
The bending or refraction of light occurs when it transitions from one medium to another, such as from air to water or from air to glass. This bending is a result of the change in the speed of light as it enters a medium with a different optical density. The change in speed causes the light wave to change direction.
In a vacuum, such as outer space, there is no material medium for light to interact with, and therefore there is no refraction. The vacuum is essentially an empty space without any particles or substances to affect the path of light. As a result, light travels in a straight line without any deviation or bending.
It's worth noting that gravity can affect the path of light in a vacuum, as predicted by Einstein's theory of general relativity. In the presence of massive objects like stars or black holes, light can be influenced by the curvature of spacetime, leading to phenomena like gravitational lensing. However, this effect is distinct from refraction and occurs due to the warping of spacetime rather than the interaction with a medium.