Transport of fast excited ions through thin solids probed by X-ray spectroscopy