Knowing the distribution of the impurity concentration in the surface layers of solids is of great importance in technologies for modifying materials by methods of surface treatment. For these purposes, it is promising to use secondary-ion mass spectrometry. Due to the fact that the depths of the surface layers analyzed by this method do not exceed several microns, the task of reducing the influence of the microroughness of the analyzed surface on the results of measuring the distribution of the impurity concentration over depth becomes urgent. Using the example of the “zirconium ceramics–thin aluminum film” system, the methodological issues of minimizing the effect of the ceramic surface microrelief on measuring the distribution of aluminum impurity ions over the sample depth after thermal annealing are solved. It is shown that the measurement accuracy increases by an order of magnitude or more if, in addition to the main measurement of the sample after thermal annealing, the measurement of the base sample, which is identical to the control sample, is carried out before thermal annealing. The desired distribution of impurity ions over the depth of the sample is determined by subtracting the distribution obtained for the base sample from the distribution of the impurity in the control sample.