Here is the Sanskrit anuvad, Hindi anuvad, and English translation of Shraddhatraya-Vibhaga Yoga Chapter 17, Verse 17.4.
यजन्ते सात्त्विका देवान्यक्षरक्षांसि राजसाः । प्रेतान्भूतगणांश्चान्ये यजन्ते तामसा जनाः ॥ १७.४ ॥
सात्विक पुरुष देवों को पूजते हैं, राजस पुरुष यक्ष और राक्षसों को तथा अन्य जो तामस मनुष्य हैं, वे प्रेत और भूत गणों को पूजते हैं |
Beings who are pure in heart and mind, who are good- natured and believe in following the path of light, these people worship the Gods of light. Individuals who are constantly active in earning material wealth and power and those people who constantly indulge in sin and corruption while living in evil darkness, worship the evil spirits.