How Much Should I Spend on Spray Foam Insulation?

What's the average cost for having spray foam insulation used in my home? It needs to be sprayed under the entire roof of my Cape Cod, in the upstairs walls, and in about half of the first floor walls. 

The Money Pit Answer

I'm very partial to Icynene.  I had an excellent experience with the product, and can't imagine recommending another manufacturer.  This was the first winter since I used it in my home, and my utility company tells me my home was among most efficient in the area this winter - which is saying a lot for a house that's more than 100 years old!
There are significant qualitative differences between home manufacturers and foam installers, and done incorrectly, this process could have a very detrimental effect on your home.  If I were you, I'd contact Icynene dealers in my area and let them compete for the job.  Generally speaking, when you get a price from a dealer that's dramatically less than everyone else's, something is being left out, and it's foolish to go with the lowest bid.  So get a sense of the average cost and ask questions of dealers from there.  Good luck!