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. The mediastinum isolates the left and right lung from each other so that they function as two separate chest cavities. 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).