How can solids undergo combustion if it only occurs in the gas phase? According to the smoldering Wikipedia article, flaming combustion occurs in the gaseous phase. I know butane undergoes flaming combustion in a Bunsen burner because it's a gas, but how can wood undergo flaming combustion at all instead of just smouldering? What gas is there to react with oxygen in the flames? Does it smoulder to create carbon monoxide then the carbon monoxide undergoes flaming combustion? Can charcoal also undergo flaming combustion? I've never seen a piece of charcoal without wood inside it undergo flaming combustion, only smoldering. 

Also, when oil undergoes flaming combustion, is it its vapour that reacts with oxygen to produce a flame?
Combustion is a gaseous phase phenomenon. Oil and gasoline have a high enough vapor pressure at ambient temperatures to produce a gaseous phase of fuel above the liquid. In contrast, hold a lighter up to a piece of wood and try to get it to light. It won't—at least not for quite some time. This is because solid fuels must first undergo endothermic pyrolysis before real combustion can occur. This produces a slew of products which are what truly undergo combustion when solids are burned. Because combustion is exothermic, once a high enough temperature is reached the solid will autopyrolyze, making combustion a self-sustaining reaction.