Directions and information on public transit to Stanford campus can be found here.

In particular note Stanford has a free shuttle bus called the Marguerite Shuttle which opperates across campus and up to SLAC and the surrounding area including to and from the Palo Alto Caltrain, maps and schedules can be found at the link above.

The closest stop to the Astrophysics building from the Palo Alto Caltrain by lines P, O and N are the Stanford Oval (~5 mins walk). Line X will go from the Palo Alto Caltrain to Y2E2 at the edge of the Engineering quad in which PAB is situated (~3 mins walk; line Y will make the return journey from Y2E2).