Bhagavad-gītā 17.4
BG 17.4
Open the full passageयजन्ते सात्त्विका देवान्यक्षरक्षांसि राजसाः । प्रेतान्भूतगणांश्चान्ये यजन्ते तामसा जनाः ॥४॥
Sanskrit
yajante sāttvikā devān yakṣa-rakṣāṁsi rājasāḥ pretān bhūta-gaṇāṁś cānye yajante tāmasā janāḥ
Translation
Men in the mode of goodness worship the demigods; those in the mode of passion worship the demons; and those in the mode of ignorance worship ghosts and spirits.