Soft x-ray absorption spectroscopy in the M-edge region is explored as a tool for studying 4f instabilities. The quasiatomic MIV,V spectra, recorded by total-electron yield under UHV conditions, carry information on the initial-state 4f occupancy. For compounds of the heavy rare earths, even at high dilution (e.g., Tm0.05Y0.95Se), mean valences can be derived, which agree with those from lattice-constant systematics (e.g., for TmSe and Sm0.3Y0.7S). A moderate surface sensitivity allows the observation of surface-induced valence changes on EuPd3, TmS, and SmAl2. The MIV,V spectra studied for 10 Ce compounds fall in two categories: pure 3d94f1 final-state multiplets for γ-like compounds, and additional peaks at about 5 eV higher energies for α-like and intermediate systems. With increasing intensity of the satellites, which are assigned to 3d94f1 final states, the 3d94f2 multiplet structure gets washed out. An interpretation of the spectra with the recent Anderson-impurity theory of Gunnarsson and Schönhammer leads to 4f occupancies greater than 0.7, even in extreme α-like systems. In addition, MIII-edge spectra exhibit one peak in γ-like and two peaks in α-like and intermediate Ce systems, which are assigned to 3p54f1 and 3p 54f0 final corestates. With increasing α-like character, the 4f1 peak is found to move to higher energies presumably due to a decrease in 4f screening with increasing 4f hybridization.