(See also Overview of the Respiratory System.)
The lungs are housed in the chest cavity, a space that also includes the mediastinum.
The mediastinum is in the center of the chest and contains the heart, thymus, and lymph nodes, along with portions of the aorta, vena cava, trachea, esophagus, and various nerves. It encompasses the area bordered by the breastbone (sternum) in front, the spinal column in back, the entrance to the chest cavity above, and the diaphragm below. Functionally, the mediastinum isolates the left and right lung from each other. For example, if the chest wall is punctured on one side, causing the lung on that side to collapse, the other lung remains inflated and functioning, because the two lungs are separated by the mediastinum.
A bony cage (commonly called the rib cage), which is formed by the sternum, ribs, and spine, protects the lungs and other organs in the chest. The 12 pairs of ribs curve around the chest from the back. Each pair is joined to the bones (vertebrae) of the spine. In the front of the body, the upper seven pairs of ribs are attached to the sternum by cartilage. The eighth, ninth, and tenth pairs of ribs join the cartilage of the pair above. The last two pairs (floating ribs) are shorter and do not join in the front (see Figure: Diaphragm’s Role in Breathing).