We consider a model for gamma-ray production in blazars in which a relativi
stic, highly collimated electron-proton beam interacts with a dense, compac
t cloud as the jet propagates through the broad- and perhaps narrow-line re
gions of active galactic nuclei. During the propagation of the beam through
the cloud, the process of excitation of plasma waves becomes an important
energy-loss mechanism, especially for mildly relativistic proton beams. We
compute the expected spectra of gamma-rays from the decay of neutral pions
produced in hadronic collisions of the beam with the cloud, taking into acc
ount collisionless losses of the electron-proton beam. This model may expla
in the X-ray and TeV gamma-ray (both low and high emission states) of Mrk 4
21 as a result of synchrotron emission of secondary pairs from the decay of
charged pions and gamma-ray emission from the decay of neutral pions for t
he plausible cloud parameters. However, clouds cannot be too hot and too de
nse. Otherwise, the TeV gamma-rays can be attenuated by the bremsstrahlung
radiation in the cloud and the secondary pairs are not able to efficiently
produce synchrotron flares because of the dominant role of inverse Compton
scattering. The nonvariable gamma-ray emission observed from Mrk 421 in the
EGRET energy range cannot be described by the gamma-rays from decay of neu
tral pions provided that the spectrum of protons in the beam is well descri
bed by a simple power law. These gamma-rays might only be produced by secon
dary pairs scattering the soft nonvariable X-rays, which might originate in
the inner part of the accretion disk.