  We consider the critical behavior for a string theory near the Hagedorn
temperature. We use the factorization of the worldsheet to isolate the Hagedorn
divergences at all genera. We show that the Hagedorn divergences can be
resummed by introducing double scaling limits, which smooth the divergences.
The double scaling limits also allow one to extract the effective potential for
the thermal scalar. For a string theory in an asymptotic anti-de Sitter (AdS)
spacetime, the AdS/CFT correspondence implies that the critical Hagedorn
behavior and the relation with the effective potential should also arise from
the boundary Yang-Mills theory. We show that this is indeed the case. In
particular we find that the free energy of a Yang-Mills theory contains
``vortex'' contributions at finite temperature. Yang-Mills Feynman diagrams
with vortices can be identified with contributions from boundaries of moduli
space on the string theory side.
