It is the propellant that melts the foam. I've had good success with a very light spray coat first to help seal the foam.
Although I like the melty foam look for lava rocks and asteroids. I think Bulwark showed me that-- X-Wing asteroids from melty spray-painted foam.