how is light formed by energy?

Technically, light is not formed by energy; it IS energy. The light we see is just a tiny fraction of the energy spectrum that runs all the way from very very short wavelengths (gamma rays and x-rays) thorough ultraviolet, visible (from violet to red) infrared, radio waves, etc. Here is a site that covers some of the same information.

http://en.wikipedia.org/wiki/Electromagnetic_spectrum