Bhagavad Gita: Chapter 9, Verse 25

यान्ति देवव्रता देवान्पितॄ न्यान्ति पितृव्रता: |
भूतानि यान्ति भूतेज्या यान्ति मद्याजिनोऽपि माम् ||25||

yānti deva-vratā devān pitṝīn yānti pitṛi-vratāḥ
bhūtāni yānti bhūtejyā yānti mad-yājino ’pi mām

yāntigo; deva-vratāḥworshipers of celestial gods; devānamongst the celestial gods; pitṝīnto the ancestors; yāntigo; pitṛi-vratāworshippers of ancestors; bhūtānito the ghosts; yāntigo; bhūta-ijyāḥworshippers of ghosts; yāntigo; matmy; yājinaḥdevotees; apiand; māmto Me

yanti deva-vrata devan pitrin yanti pitri-vratah
bhutani yanti bhutejya yanti mad-yajino ’pi mam

Translation

BG 9.25: Worshippers of the celestial gods take birth amongst the celestial gods, worshippers of the ancestors go to the ancestors, worshippers of ghosts take birth amongst such beings, and My devotees come to Me alone.

Commentary

Devotees can only be elevated to the level of the entity they worship, just as water in a pipe can only rise to the level of the reservoir to which it is connected.  In this verse, Shree Krishna explains the implications of worshipping different entities by revealing the varieties of destinations attained.  He gives this knowledge to help us conclude that to reach the highest level of spiritual evolution we must worship the Supreme. 

The worshippers of Indra (the rain god), Kuber (the god of wealth), Agni (the god of fire), etc. go to the celestial abodes.  Then, when their account of good karmas gets depleted, they are sent back from heaven.  The Pitars are the ancestors.  It is good to harbor thoughts of gratefulness toward them, but undue concern with their welfare is detrimental.  Those who engage in the ancestor worship go to the abodes of their ancestors after death. 

Those in the mode of ignorance worship ghosts and spirits.  In the Western world, there is witchcraft; in Africa, there is black magic; in India, there are vām-marg tāntrics, who invoke ghosts and spirits.  Shree Krishna says that persons who indulge in such things take birth amongst ghosts and spirits in their next life.

The highest devotees are those who attach their minds to the Supreme Divine Personality.  The word vrata means resolve and undertaking.  Such fortunate souls, who firmly resolve to worship God and engage steadfastly in His devotion, go to His divine Abode after death.