A. You can use closed-cell spray foam that way if you want, although you should realize that the spray foam will prevent the roof sheathing from drying inward. This approach should only be used if the roof sheathing is bone dry, because it will never dry when sandwiched in this manner. Most building scientists would prefer to see fiberglass rather than closed-cell spray foam under the roof sheathing in this type of assembly.
To avoid the expense re-roofing a house that is simply suffering from nail fatigue, and to obtain optimum insulation, an 85mm layer of polyurethane foam can be sprayed onto the underside of the slates or tiles of a pitched roof. This stabilises and weatherproofs the roof by fixing the nails, battens and roofing felt. As the foam is a superior insulant, coupled with just 100mm of insulation at joist level, your roof will also meet the stringent thermal performance standards required for a new home. A typical roof can be insulated using the polyurethane treatment for around half the cost of re-roofing.
Open-cell is also known as half-pound foam. It has an R-Value of 3.5-3.6 per inch, and its density is bout 0.5 pounds per cubic food. Low-density foams like these are made partially from raw biological materials Carbon dioxide or water is also used in the makeup. Open-cell uses far less material than closed-cell, but its R-Value is lower. Also, open cell requires a vapor retarder (like gypsum wallboard) and is riskier when used for roof sheathing. It's not highly recommended that you use open-cell insulation if you live in a cold climate unless you have that extra barrier. You should also compare how much money you spend versus how effective the open-cell insulation is wherever it's installed.
Spray polyurethan foam does effectly prevent all six of these heat transfer methods from occurring. These should be the mechanisms by which you judge insulation, in addition to their R-Value. If you're uncertain about installing spray foam insulation, Energy Star has a map that recommends levels of insulation by R-value and cost-effectiveness in the United States.

This is more common with closed cell foam, but it happens with open cell foam, too. Since closed cell foam has a higher R-value per inch, installers generally spray 2" in walls and 3" in rooflines to meet the energy code requirements of R-13 and R-19, respectively. (I'm not going to dive into the energy code here, but these numbers apply to many climate zones, the latter being allowed under the UA tradeoffs rule. See the Energy Nerd's blog on this topic if you want to argue.)

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.
I don't even want to ask this question but... several years ago we hired a local contractor to spray high density foam on the roof deck and walls of our unfinished 2nd floor. We realized that the job was done poorly and cut an access into the attic space to assess things. We realize now that they spray foamed directly to the chimney (no flashing). The chimney is currently used for a woodstove and DHW venting. The DHW will go away but wood stove will remain. My question is, how bad (unsafe) is this? I have found information on foam exposure to fire but have not been able to find anything about temperature ratings in general (i.e. what happens on prolonged exposure to high temperatures).
Spray foam insulation, when properly installed is both an air barrier and when closed cell foam is used at the proper depth a vapor barrier!  Before hiring any contractor you should establish the brand of foam being used and verify that with the named manufacture.  Please ask for ESR reports and MSDS sheets on any foam being installed in your home. A couple areas where you might consider spray foam insulation include:
If you’re not familiar, spray foam is a type of insulation that expands after you spray. The foam expands and seals, avoiding any type of unnecessary moisture (which can create mold) or encouraging pests to eat through your walls. It protects the lining of your house, and even can protect the heating and cooling of your house during those unbearably cold or hot days.

I had a hole in the drywall in our bathroom that was about 2 in x 5 in that I used Great Stuff to fix. I am impressed with the characteristics of the filler. It filled the hole completely in a few seconds of application. I will warn anyone using it though to make sure you don't fill the hole entirely flush to the wall because this stuff continues expanding after you apply it. I didn't think about that but no big deal really because you can sand it which is exactly what I did, and then applied spacial and paint and it is almost as good as new. For the price this was a heck of a deal because I only used a tiny amount and now am left with nearly a full can. I guess I will have to find somewhere else to use it now. Great product, ... full review

Although we are a small-town company, we can handle any size project or building. We have been blessed to work for residential homeowners as well as corporations like Bell Helicopter, Taco Bell, Tyson Foods, and even the Texas Rangers!  Our conservative Christian family values won’t let us give you anything less than an honest evaluation of the best product for your specific application. SprayFoam Texas installs the most energy efficient attic systems available anywhere. 

Polyurethane is a closed-cell foam insulation material that initially contains a low-conductivity gas in its cells.[5] As a result of the high thermal resistance of the gas, spray polyurethane insulation typically has an initial R-value around R-3.4 to R-6.7 per inch.[5] In comparison, blown fiberglass typically has an R-Value of only R-3 to R-4 per inch.[6]
Although spray polyurethane foam has many advantages over other types of insulation, spray foam installation isn’t foolproof. Some builders have reported problems with sloppy foam insulation. For example, some installers have been known to begin spraying before the chemical components are up to temperature, which can affect component mixing and foam performance. When components are poorly mixed, or mixed in the wrong ratio or at the wrong temperature, cured foam has been known to shrink away from rafters or studs, leaving cracks. Some installers rush through their spraying, resulting in voids.
Thoroughly clean the roof surface. Roofs collect oils from asphalt, chimneys, and cars plus lots of dirt and dust. Coatings don’t stick well to any of these. We recommend cleaning with an inexpensive solution of TSP or TSP Substitute in a bucket of water (follow label instructions). Use a broom to scrub ponding areas and areas of peeling coatings. Work a section at a time and hose off the dirty water. Sweep away puddles to promote drying. Do not allow wash water to dry on walls, furniture, windows, and visible surfaces. 

Spray Foam Roof Insulation