Free energy for the heterogeneous systems with spherical interfaces