Determining the phase diagram of interacting quantum many-body systems is an important task for a wide range of problems such as the understanding and design of quantum materials. For classical equilibrium systems, the Lee-Yang formalism provides a rigorous foundation of phase transitions, and these ideas have also been extended to the quantum realm. Here, we develop a Lee-Yang theory of quantum phase transitions that can include thermal fluctuations caused by a finite temperature, and it thereby provides a link between the classical Lee-Yang formalism and recent theories of phase transitions at zero temperature. Our methodology exploits analytic properties of the moment generating function of the order parameter in systems of finite size, and it can be implemented in combination with tensor-network calculations. Specifically, the onset of a symmetry-broken phase is signaled by the zeros of the moment generating function approaching the origin in the complex plane of a counting field that couples to the order parameter. Moreover, the zeros can be obtained by measuring or calculating the high cumulants of the order parameter. We determine the phase diagram of the two-dimensional quantum Ising model and thereby demonstrate the potential of our method to predict the critical behavior of two-dimensional quantum systems at finite temperatures.