Oil is long CH-chains (that is carbon and hydrogen, which when it burns make C02 and H20)
http://www.newton.dep.anl.gov/askasc.../chem00937.htm
Coal is in many ways the same, except that its harder to burn hot enough. If it don't burn hot enough CO are released instead of CO2, and CO is very poisonous. Further more it releases more PO3 and SO2, which are the stuff that cause acidic rain.