We calculate the gamma-ray spectrum of a distant blazar, PKS 1424+240, located at redshift z ≥ 0.6035, where the optical depth to primary gamma rays of the highest observed energies is τ ≥ 5. The spectral shape agrees well with what is expected from secondary gamma rays produced in line-ofsight interactions of cosmic rays with background photons. In particular, we find an acceptable agreement with the source redshifts in the range 0.6 ≤ z ≤ 1.3. We discuss the implications of existing and future data for models of extragalactic background light (EBL) and for the redshift of the source. In the case of a future detection of temporal variability at lower energies, one can set more restrictive limits on both the source redshift and the EBL spectrum.