We employ a recently developed formalism to calculate the electric field which optimally controls the dynamics of a molecule on an excited potential energy surface. The calculations begin by choosing a target distribution in phase (position-momentum) space. Next a molecular response function is constructed which contains information about the target, the field-free evolution of the molecule on the excited surface and the Franck-Condon factors between the ground and excited surfaces. The eigenvectors of the molecular response function are the optimal fields, and the eigenvalues are the target yields. In the weak field limit, the eigenvector associated with the largest eigenvalue is the globally optimum field. Results for the Na{sub 2} and I{sub 2} molecules illustrate how the vibrational states mode-lock to produce the selected final distribution. The optimal fields are fairly simple, and can be well fit by a series of chirped Gaussian pulses. We discuss how our predictions can be verified in experiments.