There are two cell types that make up the wall of the alveoli. Type I alveolar cells (also called type I pneumocytes) predominate (95%) and are simple squamous cells having the primary function of gas exchange from the alveoli to the blood. The internal surface of alveoli is moist because of the high humidity of the air coming in. These water molecules on the interior surface of the alveoli attract one another (cohesion) and cause the alveoli to collapse. Fortunately, however, the more cuboidal type II pneumocytes (also called type II pneumocytes) secrete surfactant - a detergent-like substance (amphipathic molecule) that decreases surface tension caused by the water molecules.
The respiratory membrane is what separates the inside of the alveolus from the blood. It consists of six layers that gases must cross to enter the blood from the alveoli or vice versa. Imagine molecules of oxygen and carbon dioxide that must pass through the following six layers.
1) fluid covering the inside of the alveoli (surfactant)
2) squamous cells (alveolar epithelium) lining the alveoli
3) basement membrane of alveolar epithelium
4) small space between two basement membranes (interstitial space)
5) basement membrane of capillary endothelium
6) squamous cells that make up the wall of the capillaries (capillary endothelium)