  Active galactic nuclei (AGN) can produce both gamma rays and cosmic rays. The
observed high-energy gamma-ray signals from distant blazars may be dominated by
secondary gamma rays produced along the line of sight by the interactions of
cosmic-ray protons with background photons. This explains the surprisingly low
attenuation observed for distant blazars, because the production of secondary
gamma rays occurs, on average, much closer to Earth than the distance to the
source. Thus the observed spectrum in the TeV range does not depend on the
intrinsic gamma-ray spectrum, while it depends on the output of the source in
cosmic rays. We apply this hypothesis to a number of sources and, in every
case, we obtain an excellent fit, strengthening the interpretation of the
observed spectra as being due to secondary gamma rays. We explore the
ramifications of this interpretation for limits on the extragalactic background
light and for the production of cosmic rays in AGN. We also make predictions
for the neutrino signals, which can help probe acceleration of cosmic rays in
AGN.
