Green flashes are formed when the prismatic action of the atmosphere splits the setting sun into basic R-G-B colors. Temperature inversions create a mirage, magnifying the green into an eye-catching flash.
Blues flashes are formed in the same way, but they are generally harder to see than green flashes, because blue flashes blend into the surrounding blue sky. When the air is exceptionally clear, however, the blue flash emerges.
www.spaceweather.com