Wax and kerosene oil burn with flames because they vaporize during combustion. When heated, these substances first melt (in case of wax) or form vapours (in case of kerosene), which then mix with oxygen and burn producing a flame. Flame is produced only when gaseous substances burn. Not all combustible substances produce flames - charcoal burns without a flame because it doesn't vaporize.