Abstract. For a given order R in an imaginary quadratic field K, we study the specialization of the set CM(R) of Heegner points on the Shimura curve X = X 0 (D, N ) at primes p | DN . As we show, if p does not divide the conductor of R, a point P ∈ CM(R) specializes to a singular point (resp. a connected component) of the special fiberX of X at p if p ramifies (resp. does not ramify) in K. Exploiting the moduli interpretation of X 0 (D, N ) and K. Ribet's theory of bimodules, we give a construction of a correspondence Φ between CM(R) and a set of conjugacy classes of optimal embeddings of R into a suitable order in a definite quaternion algebras that allows the explicit computation of these specialization maps. This correspondence intertwines the natural actions of Pic(R) and of an Atkin-Lehner group on both sides. As a consequence of this and the work of P. Michel, we derive a result of equidistribution of Heegner points inX. We also illustrate our results with an explicit example.