Travelers driving to the Nicoya Peninsula need to do a little planning to figure out the best way across the Gulf of Nicoya.
The only north-south highway in Nicoya is Highway 21, which runs down the eastern ("inland") flank of the peninsula. Spur roads snake west over the mountains, connecting beach communities to civilization. Excepting a short section south of Sámara, no paved highway links the various beach resorts, which are connected by a network of dirt roads roughly paralleling the coast; at times you will need to head inland to connect with another access road.
Your ultimate destination will dictate the best approach. Get things wrong and you may regret it! Not least because several sections of the narrow dirt coast road require river fordings – no easy task in wet season, when many rivers are impassable (the section between Sámara and Malpaís is the most daunting and adventurous of wet season drives in the country). Plan accordingly, and allow much more time than may be obvious by looking at a map.
If you're heading for the far northern beaches (Playas del Coco and Bahía Culebra) it's a straight shot: follow the Pan-American Highway to Liberia then turn west on Hwy. 21, which eventually loops south.
For Playa Flamingo, Tamarindo, Nosara and Sámara, it's best to turn west off the Pan-American Highway and take Hwy. 18 via the Puente de Amistad con Taiwan (Friendship with Taiwan Bridge). You can then take Hwy. 21 north to the appropriate turn-off for your specific beach destination.
You can also reach the above beaches by taking one of two ferries that depart Puntarenas. Here's where you need to pay attention.
Ferry Naviera Tambor (tel. 506/2661-2084, ferrypeninsular [at] racsa [dot] co [dot] cr) ferries departs Avenida 3, Calles 33, in Puntarenas for Paquera daily every two or three hours 5 a.m.-p.m. ($2 pedestrians, $9 car and passengers). Take this ferry to reach Tambor, Montezuma and Malpaís. Sure, it looks like you can turn north and follow Hwy. 21 also. True enough! But BIG mistake! When I last drove it, the mountainous road north from Paquera to Playa Naranjo was a real skunk, only partially paved, with large sections worn to the bone.
Playa Naranjo is also served by ferry and makes a perfect landing stage if you're heading to Sámara or Nosara, but NOT south for Tambor, Montezuma and Malpaís. The Coonatramar Ferry  departs Puntarenas from Avenida 3, Calles 33/35 at 6:30 a.m., 10 a.m., 2:30 p.m., and 7:30 p.m. ($1.60 adult, $0.75 child, $3 motorcycle, $10.50 car).
See my Moon Costa Rica  for complete details.