Fire is not a solid, liquid, or gas; rather, it is a chemical reaction called a combustion reaction, or combustion. Combustion happens when there is the right mix of ingredients that work together to create a combustion reaction. Specifically, oxygen + fuel + heat = combustion. When these elements mix to create a combustion reaction, it is visible to humans as fire.
As mentioned above, a combustion reaction requires heat, fuel, and oxygen. Let's look at those different components.
Heat is generated when energy is applied to matter and the matter produces heat. Heat is measured as temperature and can be measured with a thermometer. Matter in this case refers to particles such as atoms that, when energy is applied, vibrate back and forth, or crash into each other, and generate heat.
Fuel can be any state of matter, such as liquid, gas, or solid. When enough heat is applied to a fuel, the particles will separate and emit a gas (hydrocarbon) that is needed for a combustion reaction. The process of particles breaking down in order to produce the chemical reaction of combustion is called pyrolysis. Sometimes, like in the case of natural gas (cooking gas), the fuel is already in gas form.
Oxygen is a gas found in air on earth. It is needed for fire.
The process is as follows: When heat is applied to fuel (either gas or fuel that has undergone pyrolysis), the particles in the fuel separate, and when they crash into each other, they reconfigure into fire. In a perfect combustion, the fire burns blue and emits only H20 (water) and carbon dioxide, both as gases.