We discuss the role and significance of molecules in the modern astrophysics. Molecular opacities govern the structure of model atmospheres of late-type stars and ultracool dwarfs. Some problems of computations of model atmosphere and synthetical spectra of cool stars are discussed. We present some successful attempts of the application of the molecular spectroscpy for the studies of late -type stars and ultracool dwarfs. Finally, some problems of fitting theoretical spectra to the observed SED are discussed.