There is a frequent train, Euskotren (usually every 30 minutes), which departs from San Sebastian. Note that this is not the same as the Renfe service which connects San Sebastian with major cities in Spain and France. You need to go to a different station altogether. The journey to Zarautz takes 30 minutes.
The Euskotren company also runs buses every hour to Zarautz from San Sebastian. There other buses in summer which arrive in Zarautz from Pamplona.
It takes 15 mins by car to arrive to Zarautz from San Sebastian by the highway A-8; which connects San Sebastian and Bilbao.
It has a fantastic beach, the longest on the coast of Gipuzkoa. The waves rolling in from the Bay of Biscay are a big attraction to surfers.
Zarautz is a great place for food lovers. It counts with highly reputed restaurants from world famous cooks like Hilario Arbelaitz  and Karlos Arguiñano . As well as many affordable traditional restaurants like Restaurante Txiliku 
Move along the coast a few miles to the small fishing village of Getaria for wonderful fish restaurants. Everything from grilled sardines, superb turbot to live big crayfish. Well worth a visit.