  The magnetic rare earth element gadolinium (Gd) was doped into thin films of
amorphous carbon (hydrogenated \textit{a}-C:H, or hydrogen-free \textit{a}-C)
using magnetron co-sputtering. The Gd acted as a magnetic as well as an
electrical dopant, resulting in an enormous negative magnetoresistance below a
temperature ($T'$). Hydrogen was introduced to control the amorphous carbon
bonding structure. High-resolution electron microscopy, ion-beam analysis and
Raman spectroscopy were used to characterize the influence of Gd doping on the
\textit{a-}Gd$_x$C$_{1-x}$(:H$_y$) film morphology, composition, density and
bonding. The films were largely amorphous and homogeneous up to $x$=22.0 at.%.
As the Gd doping increased, the $sp^{2}$-bonded carbon atoms evolved from
carbon chains to 6-member graphitic rings. Incorporation of H opened up the
graphitic rings and stabilized a $sp^{2}$-rich carbon-chain random network. The
transport properties not only depended on Gd doping, but were also very
sensitive to the $sp^{2}$ ordering. Magnetic properties, such as the spin-glass
freezing temperature and susceptibility, scaled with the Gd concentration.
