Oxygen goes through the very thin wall of the alveoli and into the bloodstream. Carbon dioxide goes the other way, from the blood to the lungs, to be breathed out.