In this paper, we propose a Bayesian-inference based recommendation system for online social networks. In our system, users share their movie ratings with friends. The rating similarity between a pair of friends is measured by a set of conditional probabilities derived from their mutual rating history. A user propagates a movie rating query along the social network to his direct and indirect friends. Based on the query responses, a Bayesian network is constructed to infer the rating of the querying user. We develop distributed protocols that can be easily implemented in online social networks. The proposed algorithm is evaluated in a synthesized social network derived from a movie rating data set of real users. We show that the Bayesian-inference based recommendation provides personalized recommendations as accurate as the traditional CF approaches, and allows the flexible trade-offs between recommendation quality and recommendation quantity.