Nice complex question! Start with the wood. It gets hot, and the heat breaks its molecules into hot little shorter molecules. These escape from the wood and rise or are sucked upwards. A little way away from the wood these molecules meet oxygen molecules, which have been drawn in by the draft. They rise together and chemically interact as they do so. That reaction spits out an energetic photon, which we see as the light of the flame. The by-products of the process are mostly carbon dioxide and water, plus other left-overs. Fuel that did not get hot enough forms smoke, and fuel that did not get a chance to find an oxygen forms soot and tar.
The shape of the flame can also be explained. The oxygen comes from the outside, so some fuel molecules in the middle of the rising column only get a chance to react once the outer layers of fuel gas have had their chance. So they have to rise higher before getting access to oxygen: hence the wide lower belly of the flame and the pointed upper tip. Put a knife into the flame of a candle and see how that interferes with the process: you will see lots of black carbon soot suddenly form where before there was transparency.So obviously the flame itself is a carbon-reaction effect.
This is also why the flame is often not obviously attached to the wood, but separated a bit: it takes a while for the oxygen to meet the fuel gas. The hottest part of the flame is not in the flame itself, but slightly beyond the tip, as anyone who has used an oxy-acetylene gas torch will know. Inside the flame there is still chemical reaction occurring, but beyond the tip there is just the superheated waste gas stream: which can be hot enough to melt steel and even ceramics.
In turn the light of the flame further heats the wood, and makes more gas fragments come out. And the rising plume of hot gases sucks in fesh air from the surroundings to feed the fire. So the whole process sustains itself while there is still wood and heat. But spread the sticks out a bit, and the radiatiant heat is diluted: everything goes colder and the fire struggles. Conversely, fire in a house can flash from one object to another, simply by the radiant heating on that remote object.
Ah, what Zog and the others would have given to know all this! Tens of thousands of years of nightly ignorance and speculation. So, print this out and take it with you to the next campfire. It will give you hours of happy contemplative engagement of your mind, to complement the comfortable warm feeling, while you check out whether you agree with me. If I am wrong, screw up the paper and add it to the warmth-making machine instead!