|MadSci Network: Chemistry|
Most plastics are made by a process called "free-radical polymerisation" in which small molecules are joined together into long chains. Although the small molecules (things like styrene and vinyl chloride) are highly toxic, the long molecules made by joining hundreds or thousands of them together (polystyrene and polyvinylchloride (PVC)) are non-toxic. At high enough temperatures, however, the free-radical polymerisation reaction goes in the opposite direction; instead of small molecules joining together to make big ones, the big ones break down to give off the poisonous small ones.
In addition, most substances give off poisonous gases when burnt. When a substance containing only the elements carbon, oxygen, and hydrogen (like wood, or sugar) is burnt, it reacts with oxygen in the air to give carbon dioxide and water. Carbon dioxide is poisonous, but you need quite a lot of it to do you harm, relatively speaking.
If burning is less complete, which happens when the flow of oxygen to the fire is slow, burning will also generate carbon monoxide (which is much more toxic than carbon dioxide) and molecules based on carbon called polyaromatic hydrocarbons, many of which are poisonous. If there is a lot of oxygen chemically bound in the substance that is burnt (like there is in wood and sugar) this is less likely to happen; most plastics, however, (like polystyrene or PVC) contain relatively little oxygen.
In addition, many plastics contain elements besides carbon, hydrogen, and oxygen, which give rise to other poisonous molecules when heated or burnt; when you heat PVC, you can generate hydrochloric acid gas from the chlorine in it, and when you heat polyacrylonitrile (another hard plastic) you can generate hydrogen cyanide gas.
I hope the answer to your question is in there somewhere!
Try the links in the MadSci Library for more information on Chemistry.