Spray foam has a fire retardant in it, which means it will not support a flame. If the source of flame is removed it will stop burning. Polyurethane foam insulation is listed as a combustible insulation under the building code.