Consider a family of K3 surfaces over a hyperbolic curve (i.e. Riemann surface). Their second cohomology groups form a local system, and we show that its top Lyapunov exponent is a rational number. One proof uses the Kuga-Satake construction, which reduces the question to Hodge structures of weight 1. A second proof uses integration by parts. The case of maximal Lyapunov exponent corresponds to modular families, given by the Kummer construction on a product of isogenous elliptic curves.