Agate is the most common variety of chalcedony which is a form of quartz. Agate is, in fact, identical with quartz in composition and physical properties.
Most agates occur in cavities of eruptive rocks or ancient lavas.
These agates have a banded structure, successive layers being approximately parallel to the sides of the cavity. During crystallization, the colored bands are not disturbed. Varieties of agate are characterized by peculiarities in the shape and color of the bands, which are seen in sections cut at right angles to the layers. Agate forms when gas bubbles trapped in solidifying lava become filled with alkali and silica-bearing waters, which coagulate into a gel. The alkali attacks the iron in the surrounding lava, and bands of the resulting iron hydroxide are created in the gel, which loses water and crystallizes, leaving the bands intact.