The Hill-Wheeler formula is applied to deriving the equation of state for finite nuclei with the Gogny effective interaction in the framework of the Hartree-Fock theory. The reasonable zero-temperature saturation properties is obtained, and the critical temperature for liquid-gas phase transition of finite nuclei is found to be around 12MeV. It is found that the phenomenological formula for surface energy which is used widely is not available when the density is far away from the normal nuclear density, and a new formula is proposed.