Invariant distributions and the geodesic ray transform