Can spray polyurethane insulation be applied directly to electrical wiring and recessed lights?

Spray polyurethane can be applied directly to electrical wiring. Recessed lights or other fixtures may require a certain amount of air circulation around them for cooling purposes. In these cases, a box can be build around the fixture with gypsum wall board; then spray foam can be sprayed directly to the outside of the box.