what kind of spray?

professional / contractor or expanding foam in the can at home cheapo?

Around here all foam insulation has to be covered by sheetrock from the interior structure
so yes, the attic can have exposed foam if it is an attic, not a a living or storage area as long as their is a cieling in between living area and insulation