The second Painlevé O.D.E. y ′′ − xy − 2y 3 = 0, x ∈ R, is known to play an important role in the theory of integrable systems, random matrices, Bose-Einstein condensates and other problems. The generalized second Painlevé equation ∆y − x 1 y − 2y 3 = 0, (x 1 , x 2 ) ∈ R 2 , is obtained by multiplying by −x 1 the linear term u of the Allen-Cahn equation ∆u = u 3 − u. It involves a non autonomous potential H(x 1 , y) which is bistable for every fixed x 1 < 0, and thus describes as the Allen-Cahn equation a phase transition model. The scope of this paper is to construct a solution y connecting along the vertical direction x 2 , the two branches of minima of H parametrized by x 1 . This solution plays a similar role that the heteroclinic orbit for the Allen-Cahn equation. It is the the first to our knowledge solution of the Painlevé P.D.E. both relevant from the applications point of view (liquid crystals), and mathematically interesting.