In overdense plasma for which the plasma frequency exceeds the cyclotron frequency, X-mode, near-perpendicular cyclotron emission does not propagate to the outboard plasma edge. However, under these conditions it remains possible for electron Bernstein waves (EBWs) to transmit emitted radiation from central plasma to the plasma exterior via a mode conversion to electromagnetic waves near the plasma edge. GENRAY is an all-frequencies, three-dimensional ray-tracing code and also calculates EBW emission (EBWE) from thermal or nonthermal relativistic distributions. The numerical methods are based on the earlier HORACE circular plasma code (R.W. Harvey et al., Proc. 7th Joint Workshop and International Atomic Energy Agency Technical Committee Meeting on Electron Cyclotron Emission and Electron Cyclotron Resonance Heating, Hefei, China, 1989), generalized to noncircular plasmas and to electromagnetic EBWs, including a parallel refractive index greater than 1. Emission and absorption are calculated on an array of points along EBW rays emanating from the antenna, and the radiation transport equation is backsolved along the EBW rays to the antenna. Hot plasma dispersion is used along with a relativistic calculation of the thermal or nonthermal emission and absorption. This paper describes the calculation and reports new results for nonthermal EBWE. Along with detailed numerical analysis, EBWE can be used to measure both thermal and nonthermal properties of the electron distribution function.