Heat travels by radiation, conduction and convection. Where there is no medium for heat to travel through, such as the heat from the sun moving through space, heat travels by radiation. When heat enters a medium or strikes an object or substance, it travels by either conduction or convection.
When heat travels by radiation through a vacuum, it is carried by subatomic particles moving in the form of electromagnetic waves. When an electromagnetic wave hits an object or substance, it transfers energy to its molecules. The molecules become excited by the transfer of energy and begin moving faster. This causes the object or substance to increase in temperature. An example of heat transfer by radiation is the energy from the sun reaching the Earth's atmosphere after traveling through space as waves. When those waves strike and excite the molecules of the gases in the Earth's atmosphere, the excited and vibrating molecules cause the air to warm.
In conduction, heat travels across molecules in a solid substance or between two substances by direct contact between them. Because the molecules are in direct contact with each other, vibrating molecules cause adjacent molecules to also vibrate.
Convection refers to the transfer of heat energy in liquids and gases in contact with each other. Unlike solids, the molecules in liquids and gases are not held in place tightly and can move about. This enables heat to move across and between liquids and gases by an actual transfer of excited molecules from a location of higher excitation to another of lesser vibration until a uniform temperature is achieved. For example, pouring cold water into hot water will result in a uniform temperature which is somewhere between the two original hot and cold extremes.