The process by which heat energy in the form of light (usually IR unless the substrate is hot enough to glow in the visible range) is emitted more strongly by warm surfaces and absorbed by other materials especially those of low IR reflectivity (think matte black finish). Radiant heat transfer does not require a medium. Foam insulation materials, such as spray foam insulation, are opaque to thermal radiation, like most solid materials. http://www.youtube.com/v/ggLAUsiuI_o
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.