When a doctor suspects a child may be born prematurely, and that the fetus's lungs are immature, a corticosteroid drug may be given to the mother at least 24 hours before the estimated time of delivery. The corticosteroid crosses the placenta to the fetus and stimulates the its lungs to produce surfactant.

Surfactant is produced by cells in the air sacs as the fetus's lungs mature, often by 34 weeks and almost always by 37 weeks of gestation. So, when there is evidence that a fetus may be born prematurely, corticosteroids almost always are given. This is to help prevent respiratory distress syndrome in premature infants. 

The most common corticosteroid used is Betamethasone, which is used to help the fetal lungs develop more quickly. It is also called Celestone and is given as an injection into muscle tissue. The use of betamethasone can decrease the chance that the baby will have respiratory distress syndrome when born. Sometimes doctors use dexamethasone, which is a very similar medicine. Side effects may include sleeplessness and higher blood sugar levels for the mother and decreased fetal movement for the baby.