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.
For large jobs, professionals such as Dr. Energy Saver use two-part foam, which comes in larger containers. With 2-part spray foam, it's necessary to mix separate resin and catalyst compounds at the application nozzle. Combining these ingredients starts a chemical reaction that creates expanding foam. Contractors use small 2-part foam "kits" to air-seal an attic or to seal and insulate ductwork. To insulate an entire attic or wood-framed wall with spray foam, the resin and catalyst compounds are pumped to the application nozzle from 50-gallon drums in a specially equipped truck.