What should I do if the professor I intended to work with has moved to a different school? So, without giving out the details about the school. I joined a graduate program at school X, because I was really interested in work of professor Y. I met him during the graduate school visit and I accepted the offer to join school X.

Though Prof. Y did not officially accept me as his graduate student, he said come and meet me when school starts and we can figure out your research direction. Now, when I came to start at this school; I found out the professor Y has left and joined a different school Z. 

I don't know what do now. My decision of joining school X was based on my intentions to work with Prof Y. Also, on top of that the school X now just has one faculty working in my interested area.  

To be precise I am starting the PhD program now (Fall , 1st sem). I am not sure what my next step should be? I would appreciate any suggestions on the given situation.
Yeah, this happens. :(

I would recommend applying to school Z during your first year at school X. This would be very natural under the circumstances, and nobody (in particular, not those at school X) will think less of you for it.

Further, I'd recommend:


E-mail and ask Prof. Y if he'd be willing to vouch for you with the graduate admissions committee at school Z. 
Simultaneously apply to a couple of other programs that might be more suitable for you than school X. This goes especially if Z is substantially more selective than X, so you are far from sure that you'll get in.
Kick ass in your first year at X. This will keep you sharp, enable you to get a letter of support from someone at X, and better prepare you for the program at Z if you go.
Keep in mind that you might not get into Z, or you might find a research area you like at X and decide you prefer to stay. (Another reason to kick ass in your first year at X.)


Good luck to you!