The kinetic theory of runaway electron beam instability in a tokamak