The article analyzes the theme of the psychology of religion by the American psychologist William James. It is treated in the context of the works of other pioneers of psychological science at that time. James saw positive sides in religiosity/faith: it is a stimulating factor in life, an integrating aspect of human maturation and even a fundamental factor in human spiritual hygiene. Without religion, it is difficult to achieve the meaning of life, and empirical science, in his opinion, was increasingly eroding the foundations of religion. Therefore, in search of a way out, he tried to create the so-called optimistic philosophy. James explained that a psychologist can be just as objectively interested in religious phenomena as in other everyday psychological matters. Psychology can study theological phenomena, but there is one limitation – psychological research is limited to the area of human feelings and will, which means that it does not study doctrinal questions of the Church institution. The sanctity provided by faith helps a person to gain psychological balance, opens new horizons of life, broadens horizons and gives hope for eternity.