Coulomb interaction in a non-uniform dielectric medium is one of the central points in studies of large classes of nanoscale materials, such as graphene, atomically thin crystals, and their heterostructures. In recent years, this problem has been largely discussed in reference to investigations of excitons in monolayers of semiconducting transition metal dichalcogenides (S-TMD). In particular, it turned out, that the spectrum of s-type excitonic states in these 2D semiconductors doesn't follow the Rydberg series of a model system of a 2D hydrogen atom. The main reason for that is a dielectric inhomogeneity of the S-TMD structures, that modifies the Coulomb interaction between an electron and a hole in the exciton. A common approach to account for the excitonic spectra of S-TMD monolayers refers to the numerical solutions of the Schrodinger equation, in which the electron-hole attraction is approximated by the Rytova-Keldysh potential. However, the numerical solution doesn't shed the light on the general structure of the spectrum of excitons as a function of the parameters of the considered system. Here we propose an alternative approach that allows us to find the analytical expression for the spectrum of excitons and explains their other electrodynamical properties.