The external intercostal muscles contract, pulling the ribs upwards and outwards. At the same time the muscles of the diaphragm contract, pulling the diaphragm down and causing it to flatten. Both of these actions cause the volume of the thorax (chest cavity) to increase which causes the pressure to decrease to below atmospheric pressure (pressure of the air outside). This causes air to move into the lungs down the pressure gradient.