As a substance gets hotter, or as a substance gets closer to the state of gas, the particles in the substance move faster, become more spread out and have more energy. This is why Gas has the most energy while solids have the least. Therefore, the hotter a substance is the more energy it has.