If you put enough energy into a solid, eventually it will melt. At this point, the atoms and molecules in the solid are no longer held together in the crystal, lattice, or other structure. Instead, they have enough energy to break whatever bonds (covalent, ionic, or otherwise) holding them together, and now they can flow past each other. The atoms and molecules are still largely packed together as closely as they can go, and there still are bonds of a sort holding the broadly together, but no longer are they fixed in place. Such a state would be called a liquid.
If you raise the temperature of a liquid enough (to the “boiling point”), and continue to add energy, you can break the residual forces holding the liquid together, and give each molecule enough energy that it starts to bounce about freely. Add enough energy, and the liquid becomes a gas. At this point, each molecule or atom of the gas moves around freely. Molecules do very regularly collide with each other, but they’re not in constant interaction any more as is the case with a liquid.
Indeed, if you investigate the momentum and kinetic energy states available to molecules in a gas, the states are mostly empty. Unlike the valence electrons in a solid, which mostly fill up the lowest states available to them, there are many, many empty lower energy states for every gas molecule. As such, it’s easy to change the energy of a gas molecule by a very small fraction of its current energy, as there are so many empty states about. At this point, you can approximate the available energy states as a continuum, and the gas molecules behave like classical particles. A traditional gas is described by the Maxwell Boltzmann distribution, which specifies the fraction of gas molecules that will be moving at any velocity given the temperature of the gas and the mass of each molecule. This description applies to the air around us, to the gas between the stars, and to the gas in atmospheres of stars.
Solid, liquid, and gas are the standard “three states of matter.” If you ionize a gas— that is, if you tear an electron off of a substantial fraction of the gas atoms— it becomes a plasma, the fourth state of matter. Because the individual particles in a plasma are electrically charged (either positive ions or negative electrons), electric and magnetic fields can greatly influence the behavior of a plasma. There are a few ways to create a plasma. One is just to raise the temperature of the gas high enough so that the average kinetic energy of any particle is high enough that collisions will tend to ionize gas molecules. Another is to shine ionizing radiation— generally ultraviolet or x-ray radiation— on the gas. Interstellar gas around young massive stars is typically mostly ionized as a result of the radiation from those stars, even though the temperature of the gas itself isn’t high enough to maintain that ionization. A final way to ionize gas is to run high energy particles through it. For instance, if you can shoot an electron beam through dilute gas, it will tend to ionize the gas it passes through. This is how plasma discharge tubes are created.