Modeling a single crystal of cuprate high-T c superconductor, such as Bi 2 Sr 2 CaCu 2 O 8+␦ , as a stack of intrinsic Josephson junctions, we formulate explicitly the cavity phenomenon of plasma oscillations and electromagnetic ͑EM͒ waves in mesas of cylindrical and annular shapes. The phase differences of the junctions are governed by the inductively coupled sine-Gordon equations, with the Neumann-type boundary condition for sample thickness much smaller than the EM wavelength, which renders the superconductor single crystal a cavity. Biasing a dc voltage in the c direction, a state with Ϯ kinks in the superconductivity phase difference piled up alternatively along the c axis is stabilized. The Ϯ phase kinks provide interlock between superconductivity phases in adjacent junctions, taking the advantage of huge inductive couplings inherent in the cuprate superconductors, which establishes the coherence across the whole system of more than ϳ600 junctions. They also permit a strong coupling between the lateral cavity mode of the transverse Josephson plasma and the c-axis bias, and enhance the plasma oscillation significantly at the cavity modes which radiates EM waves in the terahertz band when the lateral size of mesa is set to tens of micrometers. It is discussed that the cavity mode realized in a very recent experiment using a cylindrical mesa can be explained by the present theory. In order to overcome the heating effect, we propose to use annular geometry. The dependence of frequency on the radius ratio is analyzed, which reveals that the shape tailor is quite promising for improving the present technique of terahertz excitation. The annular geometry may be developed as a waveguide resonator, mimicking the fiber lasers for visible lights.