Job 31:26

if I have seen the sun when it shined, or the moon moving in splendor,

Ezekiel 8:16

He brought me into the inner court of Yahweh's house; and see, at the door of the temple of Yahweh, between the porch and the altar, were about twenty-five men, with their backs toward the temple of Yahweh, and their faces toward the east; and they were worshipping the sun toward the east.

Deuteronomy 4:19

and lest you lift up your eyes to the sky, and when you see the sun and the moon and the stars, even all the army of the sky, you are drawn away and worship them, and serve them, which Yahweh your God has allotted to all the peoples under the whole sky.

Deuteronomy 17:3

and has gone and served other gods, and worshiped them, or the sun, or the moon, or any of the army of the sky, which I have not commanded;

2 Kings 23:5

He put down the idolatrous priests, whom the kings of Judah had ordained to burn incense in the high places in the cities of Judah, and in the places around Jerusalem; those also who burned incense to Baal, to the sun, and to the moon, and to the planets, and to all the army of the sky.

2 Kings 23:11

He took away the horses that the kings of Judah had given to the sun, at the entrance of the house of Yahweh, by the room of Nathan Melech the officer, who was in the court; and he burned the chariots of the sun with fire.

Jeremiah 44:17

But we will certainly perform every word that is gone forth out of our mouth, to burn incense to the queen of the sky, and to pour out drink offerings to her, as we have done, we and our fathers, our kings and our princes, in the cities of Judah, and in the streets of Jerusalem; for then had we plenty of food, and were well, and saw no evil.

Genesis 1:16-18

God made the two great lights: the greater light to rule the day, and the lesser light to rule the night. He also made the stars.

Deuteronomy 11:16

Take heed to yourselves, lest your heart be deceived, and you turn aside, and serve other gods, and worship them;

Psalm 8:3-4

When I consider your heavens, the work of your fingers, the moon and the stars, which you have ordained;

Jeremiah 8:2

and they shall spread them before the sun, and the moon, and all the army of the sky, which they have loved, and which they have served, and after which they have walked, and which they have sought, and which they have worshiped: they shall not be gathered, nor be buried, they shall be for dung on the surface of the earth.

Treasury of Scripture Knowledge

Summary

If I beheld the sun when it shined, or the moon walking in brightness;

General references

Bible References

Beheld

Genesis 1:16
God made the two great lights: the greater light to rule the day, and the lesser light to rule the night. He also made the stars.
Deuteronomy 4:19
and lest you lift up your eyes to the sky, and when you see the sun and the moon and the stars, even all the army of the sky, you are drawn away and worship them, and serve them, which Yahweh your God has allotted to all the peoples under the whole sky.
Deuteronomy 11:16
Take heed to yourselves, lest your heart be deceived, and you turn aside, and serve other gods, and worship them;
Deuteronomy 17:3
and has gone and served other gods, and worshiped them, or the sun, or the moon, or any of the army of the sky, which I have not commanded;
2 Kings 23:5
He put down the idolatrous priests, whom the kings of Judah had ordained to burn incense in the high places in the cities of Judah, and in the places around Jerusalem; those also who burned incense to Baal, to the sun, and to the moon, and to the planets, and to all the army of the sky.
Jeremiah 8:2
and they shall spread them before the sun, and the moon, and all the army of the sky, which they have loved, and which they have served, and after which they have walked, and which they have sought, and which they have worshiped: they shall not be gathered, nor be buried, they shall be for dung on the surface of the earth.
Ezekiel 8:16
He brought me into the inner court of Yahweh's house; and see, at the door of the temple of Yahweh, between the porch and the altar, were about twenty-five men, with their backs toward the temple of Yahweh, and their faces toward the east; and they were worshipping the sun toward the east.

The moon

Psalm 8:3
When I consider your heavens, the work of your fingers, the moon and the stars, which you have ordained;
Jeremiah 44:17
But we will certainly perform every word that is gone forth out of our mouth, to burn incense to the queen of the sky, and to pour out drink offerings to her, as we have done, we and our fathers, our kings and our princes, in the cities of Judah, and in the streets of Jerusalem; for then had we plenty of food, and were well, and saw no evil.

General references

Psalm 104:19
He appointed the moon for seasons. The sun knows when to set.
1 Corinthians 15:41
There is one glory of the sun, another glory of the moon, and another glory of the stars; for one star differs from another star in glory.