We have analyzed the stability of betalains in juices prepared from Moroccan yellow cactus pears (Opuntia ficus indica (L.) Mill.) as a function of temperature and pH. The experiments were carried out at temperatures ranging from 80 to 100 degrees C with juices at pH 3.5, 5 and 6.5. The degree of pigment retention decreased when the temperature increased. The degradation constant rates were determined for thermal degradation rates of pseudo-first order. The Arrhenius plot obtained for the degradation of betaxanthin from the yellow fruits was not linear. Regardless of the temperature of treatment, the lowest degradation was obtained for pH 5. When some stabilizers were tested for the protection of pigments, the results showed that ascorbic acid was a better protective agent at pH 3.5, increasing the protection by 40%. The inhibitive action of betalain pigments extracted from cactus pears towards corrosion of stainless steel in phosphoric acid was investigated using electrochemical polarization and electrochemical impedance spectroscopy (EIS) methods. It was found that the presence of natural pigments reduces the corrosion rate of the tested metal, especially on addition of the red pigments (97%). The inhibition efficiency increases as the pigment concentration of extracts increases. It was also found that the pigments tested act as mixed inhibitors. The inhibitive action of the extracts is discussed in term of adsorption and that such adsorption follows a Langmuir adsorption isotherm. The calculated values of the free energy of adsorption indicated that the adsorption process is spontaneous.