The intercostal muscles connect between the ribs. They are arranged in three layers: the external layer, the internal layer and the innermost layer. Their primary role is to compress the ribs to exhale air while breathing.
The diaphragm extends across the bottom of the rib cage. It separates the thoracic cavity, containing the heart, lungs and ribs, from the abdominal cavity. The diaphragm plays an important role in breathing. The diaphragm and the internal intercostal muscles expand the thoracic cavity to cause inspiration or inhaling of air.
The transversus thoracis is on the inner front wall of the rib cage. These muscles also play a role in breathing by compressing the rib cage for exhaling.