The Maori tell a tale of Hina, the MOON, who caused a RAINBOW to span the heavens even down to the earth, for her mortal husband to return to earth to end his days, since death may not enter her celestial home.
This reminds me of the rainbow bridge in Norse mythology (forced Norse connections ftw) called the Bifröst that connects Midgard (Earth) with Asgard, home of the Gods. Bifröst can only be used by Gods and those who are killed in battle. It is eventually shattered under the weight of war - the Ragnarok. The notion that the rainbow bridge to heaven is attainable by only the good or virtuous, such as warriors and royalty, is a theme repeated often in world myths.
Because of this I'm going to go ahead and make a wiiiiiiild
assumption that the villainous team(s) in Sun/Moon will try to create their own Bifröst, their own rainbow/moonbow bridge by harnessing Solar/Lunar power. As stated above these rainbow bridges were used to reach the realm of the Gods (which in Pokemon lore, Gods from world myths can be substituted with Legendary Pokemon). Perhaps the evil team(s) are trying to reach a certain Legendary Pokemon or something along those lines with the use of this bridge. Or they force the Sun/Moon legendary to create a rainbow/moonbow bridge for whatever evil reason.
(Although I know I'm probably most definitely waaaaay off).
Also more rainbow stuff that ties into Hawaiian deities associated with the sun and moon. Anuenue, the rainbow maiden, appears in Hawaiian legends as the messenger for her brothers, the Gods KANE and KANALOA.
Kane governed the northern edge of the ECLIPTIC, Kanaloa the southern; Kanaloa points to hidden springs, and Kane then taps them out. In this way, they represent a divine DUALITY of wild and taming forces like those observed (by Georges Dumézil) in Indo-European chief god-pairs like (more Norse connections) Odin–Týr and Mitra–Varuna, and like the popular yin and yang of Chinese Taoism.
Kane is the creator and gives LIFE associated with dawn, SUN and sky.
However, Kanaloa is depicted as a god of evil, DEATH, or the Underworld.
(Life and death eh, they remind me of a stag and eagle I know).
Maybe I'm looking into rainbows a bit too much but I have a gut feeling that they
may be important. Considering rainbows occur both during the day and night.