Knowing how far apart molecules are in each state best ranks solids, liquids, and gases from least dense to most dense.
Density describes how much mass is contained in a certain volume
That is the definition of density: Density = mass/volume.
If you keep the volume constant but make the molecules closer together, you will be able to pack in more molecules (more mass).
In solids, the molecules are close together. They have the most mass in a given volume, so they have the greatest density.
In gases, the molecules are far apart. They have the least mass in a given volume, so they have the smallest density.
In liquids, the molecules are a little further apart than in solids. Thus, their density is between that of liquids and gases.
close together _________________________________far apart
solids___liquids ________________________________gases