The mass spectra and electromagnetic decay rates of charmonium, bottomonium and B c mesons are comprehensively investigated in the relativistic quark model. The presence of only heavy quarks allows the expansion in powers of their velocities. All relativistic corrections of order v 2 /c 2 , including retardation effects and one-loop radiative corrections, are systematically taken into account in the computations of the mass spectra. The obtained wave functions are used for the calculation of radiative magnetic dipole (M1) and electric dipole (E1) transitions. It is found that relativistic effects play a substantial role. Their account and the proper choice of the Lorentz structure of the quark-antiquark interaction in a meson is crucial for bringing theoretical predictions in accord with experimental data. A detailed comparison of the calculated decay rates and branching fractions with available experimental data for radiative decays of charmonium and bottomonium is presented. The possibilities to observe the currently missing spin-singlet S and P states as well as D states in bottomonium are discussed. The results for B c masses and decays are compared with other quark model predictions.