Light my fire
For obvious reasons I am not going to describe how to set fires - common techniques are well-known and I don't want to suggest any novel methods. If you are interested in how fires are investigated, Don Winslow's California Fire and Life contains some fascinating information and Patricia Cornwell's Point of Origin is also worth reading. This section comprises a few topics which may prove useful to writers - and may help to avoid some basic errors.
The infernal triangle
For a fire to start - and continue - three things must be present: fuel, oxygen and heat. These are known as the fire triangle. If one is missing the fire won't start and removing any one will stop a fire that is already burning.
This needs a little expansion. The fuel (any flammable material) must be in an appropriate form to burn - a lump of coal, for instance, needs a substantial input of heat, e.g. from kindling wood, to catch alight but fine particles of coal dust sprayed into the air can be ignited by a small flame. Flammable dust explosions (a well-known industrial hazard) work because the fuel is finely divided and also because it is well mixed with air - another key factor. Philip Pullman used this phenomenon to good effect with a flour explosion in Northern Lights.
The proportions of oxygen and fuel have to be right for a fire - or dust explosion - to take place. Car engines, for instance, can flood if the accelerator is pumped too much and fail to start because there is too much fuel and not enough air in the cylinders. In the opposite situation there is too much air and not enough fuel for a flame to start (see below for more on igniting motor fuels).
Of course, you don't need oxygen just to start a fire - it must be available continuously to keep the fire going. Common fire extinguishers work by excluding oxygen from a blaze e.g. with a layer of foam, sand, a blanket of carbon dioxide or an inert gas (although such gases also work by another, more complicated, mechanism). Water-based fire extinguishers also stop the fire by removing heat.
Some things to bear in mind when writing a fire scene: if the space is confined, e.g. a room without significant ventilation, a fire could burn out relatively quickly once the oxygen in the air is used up. Unfortunately, anyone in the room would suffocate for the same reason, if the heat or smoke doesn't kill them first. Similarly, using a carbon dioxide or inert gas fire extinguisher in a confined space would risk suffocating anything breathing without a personal air supply. Note that opening a door and letting fresh air into the room could restart the fire if there is sufficient heat left in the fuel.
A final point, which I'll discuss in detail later, is that the source of ignition must be sufficiently energetic (powerful) to start the blaze. Some fuel/air mixtures are so unstable that the slightest spark can set them off - tankers unloading some flammable liquids have to be earthed to ensure no static electricity builds up and sparks an explosion. Others require a more powerful spark or a naked flame. Using a magnifying glass to ignite paper works by concentrating the sun's rays onto a small area so that the energy intensity is multiplied manyfold. Should you be thinking of using this in a plot, however, do experiment first to see which way the focused rays will go - the device in the oft-republished Doomdorf Mystery would be highly unlikely to work given the information in the story.
Unholy smokeMost people killed in house fires do not burn to death: they are poisoned. Many materials found in modern homes (carpets, fabrics, furniture foam) release toxic gases such as hydrogen cyanide and carbon monoxide when they burn. As smoke fills a burning building these gases circulate and a few minutes inhalation can prove fatal, long before the flames reach the victims. Even relatively brief exposure can cause long-term health problems. Firefighters wear respirators for good reasons and unprotected persons charging into a burning building to rescue someone could be rapidly overcome by smoke (as well as being struck by falling debris). The prognosis is not good for someone trapped in a cellar with a burning mattress who is rescued when smoke is seen pouring out of a trapdoor.
Cigarettes, sparks and bulletsSmoking kills - but not usually when a lit cigarette is dropped into a pool of petrol (gasoline). There would be insufficient usable heat in the glowing end to ignite the air/vapour mixture above the pool and once the cigarette is immersed in the petrol it would be extinguished immediately. Exhaustive experiments carried out by the creators of the website www.intuitor.com/moviephysics found that this Hollywood cliche wouldn't work. This is not to say it couldn't happen under extreme and bizarre circumstances but if you want to ignite a pool of petrol you'd be better off using a burning rag or throwing a lighter into it - provided, of course, that the draught in flight did not extinguish the lighter flame. I hasten to add that this is not a reason to smoke while filling up a car with petrol.
Sparks, too, do not ignite petrol readily. Hollywood is fond of depicting bullet impacts striking sparks from a variety of surfaces and sometimes igniting petrol. This is wrong on two counts. Firstly, most small arms bullets are lead or copper-jacketed lead and neither of these metals will produce a spark on impact with anything else. Secondly, even if the bullet contains steel, which can spark on impact, it wouldn't produce a sufficiently powerful spark when fired into a car's petrol tank to start a fire. Furthermore, the fuel/oxygen mixture in the tank would be too rich to ignite. The only type of bullet almost guaranteed to ignite petrol would be an incendiary round - one containing a material such as white phosphorus which is designed to ignite flammable material on impact. This would, however, still require air to mix with the fuel vapour in the tank. Such ammunition is used in large calibre military weapons and is not available to private citizens, even in the USA.
For a more detailed discussion of these points, and the physics behind them, see the above website or read Tom Rogers' excellent book Insultingly Stupid Movie Physics.
Gas and diesel
The above discussion applies to petrol as used in most conventional cars. Gas (not gasoline) is different since it is much easier to ignite. Some vehicles use LPG (Liquefied Petroleum Gas) in place of petrol. This is much more flammable and, mixed in the appropriate ratio with air, can be ignited by a spark. The fuel tanks are pressurised and strong but if they ruptured in a crash a highly flammable mixture of gas and air would form. Natural gas (mainly methane) is even easier to ignite which is why you should never turn any electrical equipment on or off if you suspect a gas leak - the tiny spark which jumps across the terminals in the switch can be sufficient to ignite a gas/air mixture.
At the opposite end of the flammability scale is diesel. This is very difficult to ignite, even with a flame. Diesel cars do not catch fire in crashes and diesel will not explode except under extreme circumstances. The scene in a UK TV programme where someone caused an explosion in a diesel-powered generator by fiddling with the electrics and causing sparks was just daft.
Spontaneous combustionCharles Dickens was probably the first author to include spontaneous human combustion in a novel - the character Krook dies as a result of spontaneous combustion in Bleak House. In reported cases of this phenomenon a body has caught fire and burned to ashes without significantly affecting its surroundings. Unfortunately for the plot, although human combustion can occur, it is not spontaneous - a source of ignition must be present. What can happen is the slow combustion of a body, particularly one with much body fat, involving the wick effect. An initial small fire, e.g. burning clothing, melts subcutaneous fat which seeps into clothing much as wax does around a candle wick. This burns slowly and steadily, producing localised high temperatures which destroy much of the rest of the body. Unless there is combustible material nearby, the fire need not spread. I should emphasise that this is a rare phenomenon, requiring special circumstances so it could be risky to use it in a plot (although it was used in an episode of the BBC TV series New Tricks).
Spontaneous combustion can happen when certain chemicals are mixed with each other. Also, some oxidising agents - substances which contain readily available oxygen - can cause fires when dispersed onto flammable materials such as paper or wood shavings. As they react with the fuel, heat builds up and ignition can occur. These are specialised materials, not available to the general public. Rags and paper towels, however, can catch fire when certain types of oil are spread on them as the oils react with oxygen in the air, generate heat, and ignite. This is somewhat unpredictable and would not be a reliable plot device if a fire was required to start at a specific time.Finally, some finely powdered metals are extremely reactive and can burst into flame when exposed to air - titanium and uranium are examples.