Hydrocarbons burn in oxygen during combustion, producing carbon dioxide, water, and energy in the form of heat and light. The carbon in the compound reacts with oxygen to form carbon dioxide, while hydrogen forms water.