What happens to the density of most substances as they go from a gas to a liquid to a solid?

It increases.


Density of gases is much smaller than of liquids (up to 100 times or even more), and almost all of these liquids are in turn less dense than solids (water to ice is one of the exceptions).