Consider a circular orbit and approximate the planet as a point.
The distance from Earth to a star is so large compared to the diameter of the star, which we'll call d, that we approximate the lines joining the two poles of the star with the observer as parallel to each other and to the x-axis that we choose. Thanks to symmetry, we choose our coordinates so that the plane of the planet's orbit passes through the tangent plane of the celestial sphere at the star in two places on the y-axis. By symmetry again we ignore half the cases for rotation and also ignore the direction of the orbit and only have to consider how the orbit is inclined at between 0 and pi/2 radians from the x-axis (Edit for clarity: in the XZ plane). Call that angle a.
When the radius r of the planet's orbit is such that d/r = sin(a), the planet will just barely touch the limb of the star when it is closest to the Earth. If sin(a) > d/r it will never happen and if sin(a) < d/r there will be a transit of finite length. Since there is no preference for the value of a, we conclude that the probability of the planet transiting must be $$P(sin(a) < d/r) = P{ \left( a < {arcsin \left( { d \over r } \right) } \right) } = { 2 arcsin \left( { d \over r } \right) \over \pi } $$
You will notice that for a star-grazing planet, the probability of a transit approaches certainty. Overall probability will depend on the probability distribution of semi-major axes and possibly eccentricity which I ignored here.