We establish a connection between the averaged null energy condition (ANEC) and the monotonicity of the renormalization group, by studying the light-ray operator ∫ duTuu in quantum field theories that flow between two conformal fixed points. In four dimensions, we derive an exact sum rule relating this operator to the Euler coefficient in the trace anomaly, and show that the ANEC implies the a-theorem. The argument is based on matching anomalies in the stress tensor 3-point function, and relies on special properties of contact terms involving light-ray operators. We also illustrate the sum rule for the example of a free massive scalar field. Averaged null energy appears in a variety of other applications to quantum field theory, including causality constraints, Lorentzian inversion, and quantum information. The quantum information perspective provides a new derivation of the a-theorem from the monotonicity of relative entropy. The equation relating our sum rule to the dilaton scattering amplitude in the forward limit suggests an inversion formula for non-conformal theories.