Many questions: is your vision blurred as well? Is it one eye or both? Is it a halo effect? There are so many possibilities that could cause a rainbow effect: cataracts, infections, corneal edema (that makes sense since light would pass through the extra fluid and cause a prism effect). The best idea is to have your eye doctor take a look. Hopefully it's something that can be fixed and you won't have this happen any more.
You need an opthamological evaluation. I would also suggest an evaluation by an endochronologist and a test known as an Hba1c. There are many possibilities, as ireneo stated, but in terms of differential diagnosis, "Prisms" around lights that come and go are hallmarks of developing diabetes. They generally correlate with blood sugars over 400. As the sugars go down with the day and exercise, the prisms disappear.
The Content on this Site is presented in a summary fashion, and is intended to be used for educational and entertainment purposes only. It is not intended to be and should not be interpreted as medical advice or a diagnosis of any health or fitness problem, condition or disease; or a recommendation for a specific test, doctor, care provider, procedure, treatment plan, product, or course of action. Med Help International, Inc. is not a medical or healthcare provider and your use of this Site does not create a doctor / patient relationship. We disclaim all responsibility for the professional qualifications and licensing of, and services provided by, any physician or other health providers posting on or otherwise referred to on this Site and/or any Third Party Site. Never disregard the medical advice of your physician or health professional, or delay in seeking such advice, because of something you read on this Site. We offer this Site AS IS and without any warranties. By using this Site you agree to the following Terms and Conditions. If you think you may have a medical emergency, call your physician or 911 immediately.