The ultraviolet spectrum of magnesium-doped hydrogenic (H-2, D2, HD) matrices is reported. The matrix-induced shift in. and bandwidth of, the Mg (3s2)S-1(0)-->(3p)P-1(0), free atom transition is discussed and compared to previous reports for Mg in rare gas matrices. The variation of the shift across the hydrogen series is interpreted using a Lennard-Jones model.