The mechanism of foaming a glassy polymer using sorbed carbon dioxide is studied in detail. A glassy polymer supersaturated with nitrogen forms a microcellular foam, if the polymer is quickly heated above its glass transition temperature. A glassy polymer supersaturated with CO2 forms this foam-like structure at much lower temperatures which indicates the Tg-depressing effect of CO2. Having this interpretation in mind, the overall sample morphology, i.e., a porous foam enclosed by dense outer skins, can be completely explained. The dense skins, however, are not homogeneous but show a nodular structure when analyzed by SEM and AFM. Foaming experiments with samples having a different thermal history suggest that the nucleation mechanism underlying the foaming process is heterogeneous in nature.