Final answer:
The thoracic cavity, enclosed by the rib cage, encompasses the pleural and pericardial cavities, which contain the lungs and heart respectively, and includes the mediastinum but is not lined by it. It is lined by the pleura, a protective tissue layer.
Step-by-step explanation:
The thoracic cavity is the upper part of the ventral cavity that houses important organs including the lungs and the heart. It is enclosed by the rib cage which is collectively known as the thoracic cage. Within the thoracic cavity, there are several important components, including the pleural cavities that contain the lungs, and the pericardial cavity which contains the heart and is situated within the mediastinum.
The mediastinum is a central compartment that separates the two lungs and includes the heart among other structures. Further supporting the thoracic cavity and separating it from the abdominopelvic cavity is the diaphragm, which is a vital muscle that facilitates breathing.
The thoracic cavity is therefore not actually 'lined by' the mediastinum but contains it. Instead, the cavity itself is lined by a thin tissue called the pleura. The pleura forms a protective layer around the lungs and also lines the interior wall of thoracic cavity.