To expand the lungs and fill them with air, thoracic pressure decreases. This is done by the diaphragm contracting and flattening out and the external intercostal muscles raising the ribcage upwards and outwards. As this increases thoracic volume, it decreases pressure, allowing air from the atmosphere to move into the lungs.
On expiration, the diaphragm relaxes and domes/curves up and the external intercostal muscles relax, allowing the ribcage to move down and inwards. This decreases the volume in the thorax and therefore increases pressure so air moves back into the atmosphere from the lungs. This is a passive process.
Active expiration also involves the internal intercostal muscles. The diaphragm and external intercostal muscles relax the same as in passive expiration, however the internal intercostal muscles contract. This brings the ribcage down and inwards, forcefully expelling air from the lungs. This can occur during exercise.