An alternative theory is that the medical bay had power; the black goo may actually be a nanite that was able to tap into that power - even as broadcast/radiated energy - and use that as a power source to take atmospheric gases including carbon dioxide and convert them to solid carbon-based body mass.