Although agates can form in all types of rock, a large percentage formed in volcanic lava. When the continents were first forming, layers of molten lava pushed toward the earth's surface through cracks and volcanoes. Within the lava, there were pockets of trapped gases. When these gases escaped as the igneous rock cooled and hardened, hollow cavities were left. Agates formed when the pockets filled in bit by bit with microcrystals. The colors and arrangement of the microcrystals were influenced by changes in pressure, temperature, and mineral content that occurred during the formation process.
Pictured is a specimen from the Barron Collection at the University of Texas. In this display are 140 specimens collected by Col. E.M. Barron (1903-1969), a former Texas legislator. An interesting bit of trivia: Barron was instrumental in Blue Topaz becoming the state stone of Texas.