Systems and method for treating aneurysms are provided which utilize formulations that form polymer foams in situ. The formulations generally have a buoyancy greater than or less than blood, and either float to the top of the aneurysm and foam from the top down or sink to the bottom and foam from the bottom up.