Those whose nature is sattva worship the gods; those driven by rajas worship yakshas and rakshasas; and others, people of tamas, worship the spirits of the dead and hosts of ghosts.
Explanation
Krishna is answering Arjuna's question about people who worship with faith but ignore scriptural rules. He says faith takes the colour of a person's dominant guna (quality of nature): goodness (sattva), passion (rajas) or darkness and inertia (tamas). What a person worships therefore reveals their inner makeup. Here yakshas are powerful nature-spirits and rakshasas are fierce, often hostile beings.