This is the so-called Gelfand-Kolmogorov theorem. It says:
Let $X$ and $Y$ be compact, Hausdorff spaces. Suppose that there exists a ring isomorphism $T\colon C(X)\to C(Y)$. Then there exists a homeomorphism $h\colon Y\to X$ such that $$Tf = f\circ h\text{ for all }f\in C(X).$$ In particular, $T$ is a continuous algebra isomorphism.
Click here for some references. Actually there is a more general result due to Milgram which asserts that two compact Hausdorff spaces $X$ and $Y$ are homeomorphic if and only if there exists a multiplicative bijection between $C(X)$ and $C(Y)$.