The set of points in a metric space is called an $s$-distance set if pairwise distances between these points admit only $s$ distinct values. Two-distance spherical sets with the set of scalar products ${alpha, -alpha}$, $alphain[0,1)$, are called equiangular. The problem of determining the maximum size of $s$-distance sets in various spaces has a long history in mathematics. We suggest a new method of bounding the size of an $s$-distance set in compact two-point homogeneous spaces via zonal spherical functions. This method allows us to prove that the maximum size of a spherical two-distance set in $mathbb{R}^n$, $ngeq 7$, is $frac{n(n+1)}2$ with possible exceptions for some $n=(2k+1)^2-3$, $k in mathbb{N}$. We also prove the universal upper bound $sim frac 2 3 n a^2$ for equiangular sets with $alpha=frac 1 a$ and, employing this bound, prove a new upper bound on the size of equiangular sets in all dimensions. Finally, we classify all equiangular sets reaching this new bound.