We determine when a finite Blaschke product $B$ can be written, in a non-trivial way, as a composition of two finite Blaschke products (Ritt's problem) in terms of the Clark measure for $B$. Our tools involve the numerical range of compressed shift operators and the geometry of certain polygons circumscribing the numerical range of the relevant operator. As a consequence of our results, we can determine, in terms of Clark measures, when two finite Blaschke products commute.