Temperature is just a way of measuring the average kinetic energy — or microscopic, random motion — of molecules in a material. The amount of energy or motion we put into a material has important effects on the structure of the material. What determines whether a substance is a solid, a liquid, or a gas?
It is useful to arrange forms of matter in the universe by temperature. Although this arrangement oversimplifies certain effects of pressure and other variables, it is very useful in understanding the forms of material. Starting at the lowest temperatures, we find that matter is "frozen." It exists as a solid. The particles barely move and stick together in a rigid structure. This is true regardless of whether the substance is made of atoms (for example, carbon) or molecules (like glass), or a chemical compound (like cement). The bonds are formed by the sharing of electrons between nuclei. The nuclei consist of protons and neutrons. Solids have two general forms. They can be amorphous, like glass or plastic. The atoms in amorphous solids do not have any regular pattern but are jumbled up in a fixed structure. Solids can also be crystalline, like sand or salt. The atoms in a crystalline substance lie in patterns that repeat over and over within the solid. Sometimes the regular structures continue up to scale much larger than the atom — the cubic crystals of salt can be seen with a magnifying glass. Most of the mass of the Earth, for instance, is in this solid state. The crystals that form rocks are good examples of atoms bound together in lattice patterns.
Now recall that temperature is merely a way of measuring the rate of motions of the atoms. The faster the motions, the higher the temperature, and vice versa. At absolute zero temperature, or 0 K, atomic particles would have virtually no motion (except for a tiny residual predicted by the quantum theory). Atoms in a solid are held in place so they cannot move freely. But as we raise the temperature of a solid, its atoms will vibrate faster and faster.
At room temperature, around 300 K, atoms in a typical substance are vibrating at a speed of around 1/2 kilometer per second. This energy allows many of the atoms to break loose from their lattice. When this happens, many substances melt into a liquid. In the liquid state, atoms are still in close contact but chains or groups of atoms may move among each other. A liquid takes the shape of its container. Earth's oceans are in a liquid state.
At temperatures around 400 to 600 K, atoms are moving at several kilometers per second. The chains of atoms break apart, and atoms have enough energy to leave the surface of a liquid, creating a gas. The individual atoms or molecules in a gas are moving freely. There are large spaces between the particles and they interact rarely by violent collisions. The density of most solids and liquids are similar; the densities of gases are many orders of magnitude lower. This is the state of matter of the air we breathe.
Typical phase diagram, explaining the different temperatures and pressures that are required for a substance to be in a certain phase. Click here for original source URL.
Phase diagram of water, showing the triple point. Click here for original source URL.
Most substances go from solid to liquid or from liquid to gas at very different temperatures. The transitions depend on a detailed consideration of the chemical bond. At room temperature, only the lightest atoms or molecules can be in the gaseous state. Heavy or complex molecules are always liquids or solids. But the state of a set of atoms or molecules depends only on the amount of thermal energy they contain. If you raise the temperature of a solid like iron, you can melt it (at 1813 K) and then even boil it into a gas (at 3033 K). On the other hand, if you lower the temperature of a gas, you can turn it into a liquid and even a solid. The nitrogen in the air you are breathing liquefies at about 77 K (or -196° C) and solidifies at an extremely chilly 54 K (or -219° C). Most of the universe is at temperatures that are either much higher or much lower than we are used to.
As an analogy for solids, liquids, and gases, imagine people in a gymnasium. If many people are all standing close together in their places doing exercises, they are like atoms in a solid, which vibrate but don't move from their positions. If the people are lined up in rows, they are like atoms in rock crystals, arranged in a symmetric lattice pattern. If the people scatter at random to do their exercises, they are like atoms in an amorphous solid, like glass. Now imagine a crowd of people spilling out of the stands onto the gym floor after a game, bumping into each other as they leave. This is like the behavior of a liquid. To imagine a gas, think of a few blindfolded people scattered on the gym floor. Most of the time they may move in straight lines, but occasionally people collide and careen off in a different directions. They are like molecules in a gas, which travel relatively long distances (compared to the size of single molecule), but eventually hit another molecule.
All forms of matter on Earth — solid, liquid, and gas — are cooler than matter in the Sun or in most stars. If we keep heating a gas, the speeds of the atoms increase. They hit harder and harder. At a temperature of a few thousand Kelvin, atoms hit each other with such force that the electrons break free from their orbits. The Sun's surface, for instance, has a temperature a little less than 6000 K. There the hydrogen nuclei, many of them having lost their electrons, move at speeds around 10 kilometers per second or 20 times faster than the air molecules you are breathing. Gas that has had its electrons knocked off is called ionized gas, or plasma.
Gases are heated to extremely high temperatures inside stars. In Ernest Rutherford's famous experiment, positively charged alpha particles recoiled off the positively charged nuclei of gold atoms. The electrical force usually stops atomic nuclei from coming too close together. But subject to the enormous pressure and temperature inside a star, atomic nuclei can collide and stick. A gas at a temperature of millions of Kelvin can transform elements and yield prodigious amounts of energy. This is the source of sunlight.