It changes the vibrations of the molecules.
It usually becomes less dense. Ice is an exception.
When it heats up it expands and rises, when it cools, it contracts and falls.
In almost all cases, the matter expands. Density = mass / volume. When volume increases, the density decreases, because the mass is fixed.
When matter is heated it will expand