In the past, the 2 primary foams on the market were polyurethane, and polystyrene. Now there is a 3rd, sort of, Polyisocyanurate. Actually, polyurethane is a reaction between polyisocyanate and polyol....as is "Polyisocyanurate". But "Polyiso" has been branded and apparently developed to have even better fire resistance.
Traditionally, urethane had the much greater R value, but it is more subject to degrade from light, and water (damp) will deteriorate it over time. You want to use polystyrene (blue board) under a concrete slab, e.g., as the urethane will deteriorate. In cooler boxes, where the foam is blown in between 2 metal skins, urethane (or Polyiso) is used for the maximum R value with the thinner walls.
Urethane (or polyiso)is harder to get to burn, and it doesn't "melt". It is often sprayed on, at least in industrial settings, right onto ceilings and metal side walls, etc. I believe if it is involved in a fire from other causes, it gives of cyanide gas. But it is difficult to ignite and doesn't really support combustion on by itself.
Styrene melts easily, and will burn pretty readily, too. It has less R value per inch to start with, but it is les subject ot degrade from light and moisture, and it is usually cheaper, even on a per R basis.
These are generalities. I haven't had to spec the stuff for a dozen years, and there may even be new things on the market. I gather the polyurethanes marketed as "polyiso" also have gotten the costs down somewhat compared to polystyrene.
Anybody remember cork insulation? I've worked in some marvelous houses from the 20's that were state of the art at the time, and all that stone and brickwork has a 2" layer of cork either between courses, or under the plaster. Makes thing really difficult to fasten new work to the walls, though, as there is often a good 3 - 4 inches to solid masonry.
smt