Spray foam is often used in window insulation. It is, however, important to use spray foam correctly to ensure it's effective in filling small gaps and cracks around your window frames.