In general, solids and liquids do not burn as a flame—not paper, not even gasoline. What does burn, however, are the vapors that emanate from solids and liquids.
With a lighted candle, melted wax travels up the wick. When the wax reaches the hot flame along the wick, it vaporizes. The heat from the flame is hot enough to cause the vaporized wax to oxidize (burn), and this oxidation releases more heat. The same thing happens with paper and wood. The heat from the flame is hot enough to vaporize the material, the heated vapor oxidizes, and the oxidizing vapor generates more flame and more heat.