What happens to the molecules in matter when you raise the temperature?
They start to vibrate faster and spread out.
The addition of heat energy in this case is making the molecules vibrate more, thus spreading out the molecules.
How spread out the molecules are determine what state of matter the substance is in. Gases, for example, are VERY spread out because they are the 'hottest' conventional state of matter. Liquids are the next spread out and solids follow the liquids.
Furthermore, the substance will weigh the exact same amount when cool/heated, but the density of the two states will vary since the heated material takes up more space.
Here is a picture: