The thoracic cavity ( Cavitas thoracis , Cavitas thoracica , outdated Cavum thoracis ) is the interior of the thorax in mammals that is enclosed by the ribs . It is separated from the abdominal cavity by the diaphragm . The main part of the wall (also the wall of the ribs ) forms the thorax and the fascia endothoracica lying on the inside .
The chest cavity is divided into the unpaired middle layer ( mediastinum ) and the paired pleural cavities. In the mediastinum most internal thoracic organs are: heart in the pericardium , thymus , large blood vessels (chest part of the aorta , vena cava , pulmonary trunk , azygos ), air and esophagus , various nerves ( phrenic nerve , the vagus nerve , recurrent laryngeal nerve , sympathetic trunk ) , Lymph nodes , ductus lymphaticus dexter and ductus thoracicus . Only the lungs grow laterally out of the mediastinum during embryonic development and fill the chest cavity with the exception of a small gap, the pleural cavity .