The problem of determining the structural parameters and residual stresses of rocks subjected to external influence is considered. Residual stresses were determined using the X-ray method: micro- and ultra-microscopic stresses of the 3rd kind after heat treatment. The object of the study was samples taken from different deposits of the Kyrgyz Republic. The research results showed that heat treatment in the quenching mode leads to significant changes in stresses at all structural levels. Thermal effects lead to significant changes in the structural state of rocks. In quartz-containing rocks, compressive residual stresses at the level of the crystal lattice are reduced, and with a further increase in temperature they are converted into tensile stresses. An approach based on X-ray measurements, along with other methods for studying the parameters of the structural state, ultimately makes it possible to purposefully control the deformation and strength properties of rocks and minerals, and to use changes in properties to solve problems in the extraction and processing of minerals, and in the creation of building materials.