Spray foam comes in two flavors, open cell and closed cell, and provides both parts of the building envelope - the insulation and the air barrier. The building envelope should completely surround the conditioned space, and the insulation needs to be in contact with the air barrier. Since spray foam is both insulation and air barrier, proper alignment of insulation and air barrier is guaranteed.
As this example illustrates, it's important to seal the envelope completely. One of spray foam's biggest selling points is its air-sealing ability, but it can't seal places where it's not sprayed. One of the nice things about using spray foam in new construction is that you can do a Blower Door test before the drywall goes in. Even better, you can test for leaks with a fog machine.
There is a significant price difference when it comes to using foam insulation to insulate a new versus older home. Spraying insulation inside a newly constructed home is easier because the installation company can ensure the insulation will work effectively and design it for optimum defense against sound, heat transfer and utility costs. Installing spray foam in older homes that contain existing insulation can cost additional time and money -- it is not usually recommended as compared to weatherization or an energy aduit.
One of the key differentiators between traditional insulation materials and spray foam insulation is the latter’s ability to insulate and air seal. Foam insulation provides an air barrier to wherever it is applied to help mitigate air leakage from the building. Air sealing the building envelope with sprayed-in foam insulation also helps address moisture ingress to reduce the risk of mold and mildew growth as well as the formation of ice dams in colder climate zones during the winter months. When you compare foam insulation with traditional fiberglass insulation and cellulose insulation, sprayed insulation minimizes air infiltration, it assists in limiting moisture vapor from entering and escaping the home, which in turn reduces the load on heating and cooling systems. Below is a video that compares fiberglass, cellulose and open-cell spray foam in terms of insulating and air sealing value.
Roof Spray Foam Insulation