The diaphragm and intercostal muscles (external and internal) present between the ribs help in generation of a pressure gradient between the lungs and the atmosphere.
During inspiration diaphragm is lowered by contraction of its muscle fibres and becomes flat. The external intercostal muscles contract pulling the ribs and sternum upward and outward.
This increases the volume of thoracic cavity and thus, decrease the intra-pulmonary pressure. The greater atmospheric pressure outside the body now causes the air to flow rapidly into external nares, which sequentially leads to alveoli. Thus, causing inspiration.