The opposite of a gas is a solid, where the molecules are very close together and packed tightly. In between a gas and a solid is a liquid, where the molecules are not as close together as in a solid, but not as far apart as in a gas.
The state of matter of a substance depends on its temperature and pressure. As the temperature increases, the molecules move faster and become more spread out, so the substance will change from a solid to a liquid to a gas. As the pressure increases, the molecules are forced closer together, so the substance will change from a gas to a liquid to a solid.