Based on a quantum mechanical approach, the polarization transport of photons that propagate in a medium with slowly varying refractive index is studied. The photon polarizations are separated in opposite directions normal to the ray, which is called “spin Hall effect” of photons. Also, the rotation of the polarization plane occurs, a manifestation of the Berry phase. This approach can be generalized to other spinning particles in inhomogeneous media as a universal method.