The flames turn different colors because specific elements get excited, so do their electrons. In this case, heat energy is used to excite the electrons. The excited electrons raise to a higher energy level, and as they come back down they produce a specific wavelength of light (protons). Each element has a different color.
Solution #1: LiNO3
Solution # 2: Cu(NO3)2
Solution # 3: KNO3
Solution #4: Sr(NO3)2
Solution # 5: Zn(NO3)2
Solution #6: Ca(NO3)2