What kind of foam. If it's HDU I'd suggest using Automotive primer know as catalized High Build Primer. This primer can be sprayed on very thick and will give a very smooth surface. That's what I use on all my HDU.
Please be more specific when asking questions like this. There are dozens of foams. And the type of routing may also make a difference in priming. If you woul like help, it's here if you give us a chance.
Norman Sign Company, Norman, Oklahoma, SandBlasted Signs, Sign Painter, Redwood Signs