An in situ forming foam for medical applications and a method for making same is described, the method comprising the steps of: preparing a first component, Composition A, comprising an acidic solution of a polycationic polymer selected from the group comprising polymeric amines and polysaccharides preparing a second component, Composition B, selected from the group comprising a metal carbonate, a metal bicarbonate or a mixture of a metal carbonate and a metal bicarbonate maintaining said first and second components separately prior to mixing and mixing said first and second components at an intended site of application. The foam is a mechanically robust but flexible and resilient material wherein the degree and nature of the porosity may be controlled.