Inside matter the atoms (or molecules) are always moving. For instance,
a gas (air, inside the Sun ...) might look something like this
The atoms fly about and bump into each other.
The hotter the gas is, the faster the average speed of the atoms is.
As the atoms move and change directions, they emit electromagnetic radiation.
Sometimes you can see this radiation, somethimes you can't. There is an ideal case of this, called blackbody radiation. Many real cases of warm or hot bodies emitting radiation are pretty close to this ideal case.
Blackbody radiation is emitted over a range of wavelengths.
The amount of radiation and the distribution as a function of wavelength depends on the temperature (but not on the material in the ideal case of blackbody radiation)
This gives us information about stars:
We can use this information to learn about galaxies. Here is a picture of M100. Where are the hot stars? Where are the cool stars?
Davison E. Soper, Institute of Theoretical Science, University of Oregon, Eugene OR 97403 USA soper@bovine.uoregon.edu