The muscles that separate the thoracic cavity from the abdominal cavity are primarily the diaphragm. The diaphragm is a large, dome-shaped muscle that contracts and relaxes to facilitate breathing. It forms a barrier between the thorax (chest) and abdomen and plays a critical role in respiration by altering the volume of the thoracic cavity when it moves.
In addition to the diaphragm, there are also other muscles that can aid in maintaining the integrity of the thoracic and abdominal cavities, such as the extrinsic abdominal muscles (like the external and internal obliques, rectus abdominis, and transversus abdominis) and the intercostal muscles (which are located between the ribs), though these do not directly separate the cavities but contribute to the overall function and structure of the thoracic and abdominal regions.