SB 1.17.34
yasmin harir bhagavan ijyamana
ijyatma-murtir yajatam sam tanoti
kaman amoghan sthira-jangamanam
antar bahir vayur ivaisa atma
Translation by His Divine Grace A. C. Bhaktivedanta Swami Srila Prabhupada:
In all sacrificial ceremonies, although sometimes a demigod is worshiped, the Supreme Lord Personality of Godhead is worshiped because He is the Supersoul of everyone, and exists both inside and outside like the air. Thus it is He only who awards all welfare to the worshiper.
Purport by His Divine Grace A. C. Bhaktivedanta Swami Srila Prabhupada:
It is even sometimes seen that demigods like Indra and Candra are worshiped and offered sacrificial awards, yet the rewards of all such sacrifices are awarded to the worshiper by the Supreme Lord, and it is the Lord only who can offer all welfare to the worshiper. The demigods, although worshiped, cannot do anything without the sanction of the Lord because the Lord is the Supersoul of everyone, both moving and nonmoving.
In Bhagavad-gita (9.23) the Lord Himself confirms this in the following sloka:
ye ’py anya-devata-bhakta
yajante sraddhayanvitah
te ’pi mam eva kaunteya
yajanty avidhi-purvakam
“Whatever a man may sacrifice to other gods, O son of Kunti, is really meant for Me alone, but it is offered without true understanding.”
The fact is that the Supreme Lord is one without a second. There is no God other than the Lord Himself. Thus the Supreme Lord is eternally transcendental to the material creation. But there are many who worship the demigods like the sun, the moon and Indra, who are only material representatives of the Supreme Lord. These demigods are indirect, qualitative representations of the Supreme Lord. A learned scholar or devotee, however, knows who is who. Therefore he directly worships the Supreme Lord and is not diverted by the material, qualitative representations. Those who are not so learned worship such qualitative, material representations, but their worship is unceremonious because it is irregular.