In this paper we find a general solution for the action function in the case of a heavy point moving on a sphere using the method of separation of the Hamilton-Jacobi equation variables. The solution contains two constants: the energy of a material point and the momentum projection onto a horizontal direction. We analyze the modes of a spherical pendulum oscillation. It is shown that the solution does not contain any errors of accumulation which are characteristic for evolution problems with long prediction periods.