  We study the stochastic dynamics of c and b quarks, produced in hard initial
processes, in the hot medium created after the collision of two relativistic
heavy ions. This is done through the numerical solution of the relativistic
Langevin equation. The latter requires the knowledge of the friction and
diffusion coefficients, whose microscopic evaluation is performed treating
separately the contribution of soft and hard collisions. The evolution of the
background medium is described by ideal/viscous hydrodynamics. Below the
critical temperature the heavy quarks are converted into hadrons, whose
semileptonic decays provide single-electron spectra to be compared with the
current experimental data measured at RHIC. We focus on the nuclear
modification factor R_AA and on the elliptic-flow coefficient v_2, getting, for
sufficiently large p_T, a reasonable agreement.
