The flame test is used to visually determine the identity of an unknown metal or metalloid ion based on the characteristic color the salt turns the flame of a bunsen burner. The heat of the flame converts the metal ions into atoms which become excited and emit visible light.