When in pregnancy are steroids sometimes prescribed for treating a lung condition?

Mother v Child. If the mother the benefits have to out weigh the risk. If it is the baby the time is before a premature delivery.