  We discover a transition from extended to localized quasi-modes for light in
a gas of immobile two-level atoms in a magnetic field. The transition takes
place either upon increasing the number density of atoms in a strong field or
upon increasing the field at a high enough density. It has many characteristic
features of a disorder-driven (Anderson) transition but is strongly influenced
by near-field interactions between atoms and the anisotropy of the atomic
medium induced by the magnetic field.
