This area is covered in a pleural membrane, forming the airtight pleural cavity, which allows breathing to take place. Air is drawn in and out of the lungs by changes in pressure and volume.
Inhale. Intercostal muscles contract, moving chest up and out; the diaphragm contracts and flattens. These increase the volume, so decrease the pressure, thus drawing air into the lungs.
Exhale. Intercostal muscles relax, chest moves down and in, the diaphragm relaxes, and domes upwards. Volume decreases, pressure increases and air is forced out of the lungs.
Here is the structure of the lungs and an alveolus:
Air goes into the lungs via the trachea, through the bronchi, bronchioles and then into the alveoli, where CO2 diffuses out of the blood, into the alveoli and is exhaled. And O2 diffuses into the blood stream and is transported around the body see circulation
Please see the main page respiration in Biochemistry.
It is vital that we can control the rate of breathing to maintain a constant carbon dioxide and oxygen level in the body. This is done by three different processes, which are coordinated by the medulla in the brain.
In the lungs are stretch receptors that recognize how inflated they are. When they reach a certain point they are instructed to deflate.
In the aorta are chemoreceptor cells. These can detect the concentration of carbon dioxide in the blood. If it starts getting higher, they will signal for an increase in breathing rate.
And finally there is the medulla itself which also responds to the levels of carbon dioxide in the blood.