Wood undergoes pyrolysis as it burns. Pyrolysis is the destructive distillation of the wood, producing gasses, which burn as they leave the wood, and carbon, which will also eventually burn. This is how wood normally burns.
There is a link to an article on pyrolysis below.