  We investigate the response of a stack of intrinsic Josephson junctions
(IJJs) to terahertz (THz) electromagnetic (EM) irradiation. A significant
amplification of the EM wave can be achieved by the IJJs stack when the
incident frequency equals to one of the cavity frequencies. The irradiation
excites pi phase kinks in the junctions, which stimulate the cavity resonance
when the bias voltage is tuned. A large amount of dc energy is then pumped into
the Josephson plasma oscillation, and the incident wave gets amplified. From
the profound current step in IV characteristics induced at the cavity
resonance, the system can also be used for detection of the THz wave.
