Final answer:
Corundum, including ruby, forms in Alkali basalts through crystallization. Impurities, like chromium, can change the color of corundum. Different colors of corundum, such as sapphire, result from various impurities replacing aluminum in the crystal structure.
Step-by-step explanation:
Corundum, a very hard mineral, is formed in Alkali basalts through a process of crystallization. Basaltic lava, rich in aluminum and silicon, cools and solidifies slowly, allowing the formation of large crystals. If a small amount of chromium replaces aluminum in the corundum structure, it results in the red mineral known as ruby. The presence of different impurities, such as chromium, leads to variations in color, with sapphire being another variant of corundum.