An algorithm for selecting the optimal phase when correcting turbulent fluctuations of a focused Gaussian beam is studied. The calculations are performed by the method of functional integration. It is shown that in order to optimize the average on-axis intensity of a focused Gaussian beam a phase-conjugation algorithm must be used for the correction, and the phase of a spherical wave, calculated in the approximation of the method of smooth perturbations, is employed as the correcting phase.