This is the passage in the Bible that describes where the rainbow comes from...Genesis 9:11-16
God is speaking to Noah after the flood and he tells Noah that the bow (rainbow) is a symbol of God's covenant with us, that he will never destroy the world again by a flood.
11 And I will establish my covenant with you, neither shall all flesh be cut off any more by the waters of a flood; neither shall there any more be a flood to destroy the earth.
12 And God said, This is the token of the covenant which I make between me and you and every living creature that is with you, for perpetual generations:
13 I do set my bow in the cloud, and it shall be for a token of a covenant between me and the earth.
14 And it shall come to pass, when I bring a cloud over the earth, that the bow shall be seen in the cloud:
15 And I will remember my covenant, which is between me and you and every living creature of all flesh; and the waters shall no more become a flood to destroy all flesh.
16 And the bow shall be in the cloud; and I will look upon it, that I may remember the everlasting covenant between God and every living creature of all flesh that is upon the earth.
17 And God said unto Noah, This is the token of the covenant, which I have established between me and all flesh that is upon the earth.