There are three kinds of rock: igneous, sedimentary, and metamorphic. Igneous rocks form when molten rock (magma or lava) cools and solidifies. Sedimentary rocks originate when particles settle out of water or air, or by precipitation of minerals from water. They accumulate in layers.