What do doctors do if baby gets stuck on way out?

It depends. It depends on the situation-- the position of the baby, the mother's health, and the baby's heart rate. Ob/gyn's are trained perfectly to help in this situation. Choices may range from changing mom's position, to vacuum, to forceps, to c-section.
Push them back. This rarely happens. If forceps or suction cannot get baby to move down they do a c-section. A staff member actually goes under the drapes to push the babies head back so it can be extracted from above. It is a dramatic but lifesaving process.When this happened in the early 1900's both mom and baby often perished.