  The size and geometry of the X-ray emitting corona in AGNs are still not well
constrained. Dov\v{c}iak & Done (2016) proposed a method based on calculations
assuming a point-like lamp-post corona. To perform more self-consistent
calculations of energy spectra of extended coronae, we develop monk, a Monte
Carlo radiative transfer code dedicated to calculations of Comptonised spectra
in the Kerr spacetime. In monk we assume Klein-Nishina scattering cross section
and include all general relativistic effects. We find that for a corona located
above the disc, the spectrum is not isotropic, but with harder and less
luminous spectra towards observers at lower inclinations, owing to anisotropic
illumination of the seed photons. This anisotropy also leads to an
underestimated size of the corona if we assume the corona to be a point-like,
isotropic source located on the black hole rotation axis, demonstrating the
necessity of more self-consistent calculations. We also inspect the effect of
motion and geometry of the corona on the emergent spectrum. Finally, we discuss
the implication of anisotropic corona emission for the reflection spectrum in
AGNs as well as black hole X-ray binaries (BHXRBs). We find that by assuming
the corona emission to be isotropic, one may underestimate the soft excess in
AGNs and the reflection continuum and iron K fluorescent line flux in BHXRBs.
