\textcolor from the xcolor package also works in mathmode, even if the name says otherwise. You can also use $ \color{<color>} C^2 $. It sets the color for the rest of the current scope (group).
Examples:
\documentclass{article}
\usepackage{xcolor}
\begin{document}
$ \color{red} C^2 $
$ \color{yellow} A = \textcolor{blue}{B} \mathbin{\textcolor{red}{-}} \textcolor{green}{C} $
\end{document}
Note that the \mathbin must be wrapped around the coloured, binary - here, as Leo Liu pointed out in his comment, to set the correct spacing again. The coloring changes the math type so they spacing would be different.
\eqnarrayenvironment, I find that curly bracketing can control the range of coloring. For example,{\color{red}{some symbols}}will ensure that math symbols after '}' are not colored. – Liguo Kong Jun 13 '12 at 19:56eqnarray. – kahen Oct 16 '12 at 0:28