In this work we present a method for the in situ analysis of elemental depth distributions in thin films using a combined evaluation of synchrotron x-ray fluorescence and energy-dispersive x-ray diffraction signals. We recorded diffraction and fluorescence signals simultaneously during the reactive annealing of thin films. By means of the observed diffraction signals, the time evolution of phases in the thin films during the annealing processes can be determined. We utilized this phase information to parameterize the depth distributions of the elements in the films. The time-dependent fluorescence signals were then taken to determine the parameters representing the parameterized depth distributions. For this latter step, we numerically calculated the fluorescence intensities for a given set of depth distributions. These calculations handle polychromatic excitation and arbitrary functions of depth distributions and take into account primary and secondary fluorescence. Influences of lateral non-uniformities of the films, as well as the accuracy limits of the method, are investigated. We apply the introduced method to analyze the evolution of elemental depth distributions and to quantify the kinetic parameters during a synthesis process of CuInS2 thin films via the reactive annealing of Cu–In precursors in a sulfur atmosphere.