The concept of the universe being an expanding sphere is a common analogy used to help understand the expansion of the universe. However, it's important to note that this analogy is not meant to be taken literally in terms of the shape of the universe.
In reality, the shape of the universe is a topic of ongoing scientific investigation and is still not conclusively determined. The most widely accepted current understanding is that the universe is spatially flat on large scales based on various observational data, including measurements of the cosmic microwave background radiation.
When we say the universe is expanding, it means that the distances between galaxies and other cosmic structures are generally increasing over time. This expansion is described by the metric of space itself, rather than the motion of objects within space. It's important to note that this expansion does not mean galaxies are moving away from a central point or that the universe is expanding into something else.
As for the question about light traveling in a straight line, light does travel in straight lines through space in the absence of gravitational effects or other factors that can bend its path. The expansion of space itself does not alter the straight-line trajectory of light. However, as space expands, the wavelengths of light also stretch, causing a phenomenon called cosmological redshift. This redshift is observed as a shift towards longer wavelengths and is one of the key pieces of evidence for the expansion of the universe.
In summary, the analogy of an expanding sphere is used to help conceptualize the overall expansion of the universe, but it's not meant to describe the literal shape of the universe. Light generally travels in straight lines through space, and the expansion of the universe does not alter this behavior.