The chemical composition and spectra of untreated and heat-treated rubies from Mozambique and Madagascar were analyzed by an electron probe microscopy analysis, laser ablation inductively coupled plasma quadrupole mass spectrometry, Fourier transform infrared spectroscopy, Raman spectroscopy and UV-visible spectroscopy. Due to the different content of Fe and different inclusions, rubies from Madagascar belong to alkaline basalt deposit, while rubies from Mozambique belong to amphibole metamorphic rock. The ruby samples were heated to 900 °C to change their color. As Fe and Ti ions can be transferred into different valences and diffused into the interior of rubies, Cr ions in cracks or cleavages entered the crystal lattice during heat treatment and the content of Fe and Ti decreased, while the content of Cr increased in heat-treated rubies. After heating, blue-purple decreased and the red hue increased, while the blue color band disappeared and yellow appeared in the cracks of the samples because of the chemical changes. Compared with untreated rubies, the infrared absorption peaks of 2123 cm−1 and 1990 cm−1 related to inclusions disappeared, and the existence of 3236 cm−1 and 3186 cm−1 absorption peaks was a typical characteristic of heat-treated ruby, which was produced by changes in its inclusion. In addition, due to the weakened charge transfer of Fe2+ and Ti4+ and the increasing reaction of Fe2+ → Fe3+ along with the heat treatment, the UV-visible absorption peak at 400 nm shifted to purple.