While we often refer to them as "balls of gas", it's important to understand that the gas within a star is not in the same state as the gas we experience on Earth. Due to the intense gravity and heat, the atoms within a star are stripped of their electrons, creating a superheated plasma.
So, while the main component of a star is indeed gas (primarily hydrogen and helium), it's not simply a giant, burning ball of gas in the way we typically understand "gas."