There are 2 completely different ways to do this problem:

1. By calculus: Let Q denote a point on

Then calculate the distance which will give you an equation of a function with respect to t. Calculate the minimum distance using the first derivative.

If d(t) has an extreme value then (d(t))^2 has an extreme value too. Therefore it is sufficient if you examine (d(t))^2.

Solve for t.

Calculate the coordinates of Q.

Calculate the equation of the line PQ.

2. By analytic geometry: Calculate the equation of an auxiliar plane a perpendicular to and containing P.

Then calculate the intersection of and a which is the point Q.

Calculate the equation of the line PQ.