We present an experimental and theoretical investigation of the spectroscopy of dilute alkali atoms in a solid matrix of inert gases at cryogenic temperatures, specifically Rubidium atoms in a solid Argon or Neon matrix, and related aspects of the interaction energies between the alkali atoms and the atoms of the solid matrix. The system considered is relevant for matrix isolation spectroscopy, and it is at the basis of a recently proposed detector of cosmological axions, exploiting magnetic-type transitions between Zeeman sublevels of alkali atoms in a magnetic field, tuned to the axion mass, assumed in the meV range. Axions are one of the supposed constituents of the dark matter (DM) of the Universe. This kind of spectroscopy could be also relevant for the experimental search of new physics beyond the Standard Model, in particular the search of violations of time-reversal or parity-charge-conjugation (CP) symmetry. In order to efficiently resolve the axion-induced transition in alkali-doped solid matrices, it is necessary to reduce as much as possible the spectral linewidth of the electronic transitions involved. The theoretical investigation presented in this paper aims to estimate the order of magnitude of the inhomogeneous contribution to the linewidth due to the alkali–matrix interactions (Coulomb/exchange and dispersion), and to compare the theoretical results with our experimental measurements of spectra of dilute Rubidium atoms in Argon and Neon solid matrix. The comparison of the expected or measured spectral linewidths will be important for selecting the most appropriate combination of alkali atoms and matrix inert elements to be used in the proposed axion detection scheme. It is finally suggested that dilute Lithium atoms diffused in a cold parahydrogen solid matrix could be, overall, a good system upon which the proposed detector could be based.