Abstract—: During reactive magnetron sputtering in a chemically active gas environment, the formation of a chemical compound on the target surface changes its sputtering rate. As a result, a significant change in the composition of the film being formed occurs in the narrow pressure range of the chemically active gas. In order for the process cycle to be highly reproducible, it is necessary to clearly understand the processes occurring during sputtering and ensure a high level of control of the chemically active gas. In this paper, the process of the formation of Mo–Si–N–O thin films by reactive magnetron sputtering, which are used as phase-shifting layers of phototemplates, is studied. A theoretical and experimental approach is presented for predicting and controlling the composition of multicomponent thin films formed by reactive sputtering using two separate targets in a chemically active gas environment. The experimental results of changes in the composition of Mo–Si–N–O thin films depending on the nitrogen pressure during the simultaneous reactive magnetron sputtering of two targets, molybdenum and silicon, are presented. The changes in the composition of the Mo–Si–N–O films are modeled, taking into account the kinetic theory of gases, geometric characteristics of vacuum magnetron sputtering equipment, and simple physical and chemical assumptions. It is established that the key factor determining the composition of a thin film is the process of the nitridation of targets, which leads to a sharp change in their sputtering rate. © Pleiades Publishing, Ltd. 2024.