Imagine that you lived almost 300 million years ago in a large basin area with numerous rivers and streams. All around you are trees as big as nine feet across and two hundred feet high. There are ferns and many other plants all along the rivers and streams.
As time passed, the giant trees died. Some might have been knocked over by floods or wind. Pieces of the trees floated down the rivers. Some trees were left on the land along the rivers. Some of them were buried in the mud. Most of the trees decomposed. A few of the trees were petrified into beautiful "stone trees" we can see today.
Some logs were buried by sediment from the rivers and ash from volcanoes. They did not decompose. Ground water mixed with the ash and dissolved the silica in it. Then the mixture was carried through the logs. The solution filled or replaced cell walls and crystallized as quartz. Minerals rich in iron mixed with the quartz and created a beautiful rainbow of colors.