Maxwell and Dirac fields in Friedmann–Robertson–Walker (FRW) spacetime are investigated using the Newman–Penrose method. The variables are all separable, with the angular dependence given by spin-weighted spherical harmonics. All the radial parts reduce to the barrier penetration problem, with mostly repulsive potentials representing the centrifugal energies. Both the helicity states of the photon field see the same potential, but that of the Dirac field see different ones; one component even sees attractive potential in the open universe. The massless fields have the usual exponential time dependences; that of the massive Dirac field is coupled to the evolution of the cosmic scale factor a. The case of the radiation-filled flat universe is solved in terms of the Whittaker function. A formal series solution, valid in any FRW universe, is also presented. The energy density of the Maxwell field is explicitly shown to scale as a−4. The co-moving particle number density of the massless Dirac field is found to be conserved, but that of the massive one is not. Particles flow out of certain regions, and into others, creating regions that are depleted of certain linear and angular momenta states, and others with excess. Such a current of charged particles would constitute an electric current that could generate a cosmic magnetic field. In contrast, the energy density of these massive particles still scales as a−4.