Geoids in the lava
Lava that erupts on the surface will contain some water and gases dissolved in it. It acquires them from either the source where the lava is produced or along the way as it travels to the surface through the Earth’s crust. But dissolved water and gases do not mix well with molten rock and they want to escape. So, as soon as lava stops, these components will try to exsolve (come out) from the lava. Just like when you shake a bottle of runny honey or dishwashing liquid, formed bubbles will slowly move to the top and pop. This escape is not always possible as lava cools, turning into a solid rock, and as it does so, it traps these bubbles inside forming geoids like these.
These bubbles create space in the rock, which allows the secondary minerals to grow. So slowly over time minerals will form in the gap created by the gas bubbles. In this example we have two generations of quartz. First is the agate, which creates the outer layer and the second is prismatic quartz which forms crystals on top of the agate and is growing inwards consuming rest of the available space.
Example from Kiama, Australia.














