The reaction you can see below is called Pharaoh's serpent, and it is both bizarre and amazing to watch:
So how does this work? The starting chemical is mercury thiocyanate (also known as mercuric sulphocyanate - Hg(SCN)2). Which sounds really bad, because it contains the poison mercury combined with a cyanate (i.e. cyanide). For more info see on mercury and cyanide see:
The fumes from the reaction contain mercury, and so does the solid left behind. Although people (even kids) used to play with this chemical, smart people don't do this reaction anymore except under controlled conditions. It's just too poisonous.
Today you can buy fireworks that look a little like Pharaoh's Serpent, but are not quite that dramatic. These are called black snakes. Usually the safe versions are made with sugar and baking soda. The sugar burns just like it would in a marshmallow to create a lightweight carbon ash, and the heated baking soda makes carbon dioxide gas that inflates the ash. Here is one way to try it out yourself:
[[[Jump to Fun with Chemistry #23 - Making a huge glow stick]]]