I woke at sunrise to the roar of pounding surf and eagerly poked my head out of the tent, like a kid on Christmas morning. I was stoked to see a sizable swell, but the tide was rising toward the campsite. So we gathered our gear, faced the ocean, and took a left.

A decade ago, when a buddy and I hiked down this same 60-mile stretch of Costa Rica's Pacific coast from Tamarindo to Playa Guiones, that was our mantra: "Wake up and take a left." We were trekking down the Nicoya Peninsula looking for perfect waves; when we found them we'd set up camp on the beach and start surfing. If we woke up the next day and the waves were flat or crowded, we'd just keep heading south.

Ten years later, I wanted to recapture the special feelings of freedom and access I got from traveling Costa Rica on foot accompanied only by my knapsack, tent, and board. Surfers call this "going feral," a tip of the hat to animals like the wild pig that roots around dirty and carefree looking for something tasty to eat. By walking every inch of the coastline, I'd have the chance to explore hidden coves and fishing villages, meet more locals, and sniff out uncrowded waves. Still, even die-hard surfers consider it a crazy way to travel. "Why exactly are you doing this?" asked Joe Walsh, the owner of Witch's Rock Surf Camp in Tamarindo, when I told him about my plan.

The answer was simple: That first trip, a two-month odyssey fueled by surf, cerveza, and señoritas, had changed me, convincing me to move to Southern California and pursue the surfing life. Now things were different: I was 32 years old, with a wife, toddler, career, and mortgage. Of course, trying to re-create a memory is a risky proposition. (The popular wisdom: You can never go back.) But I yearned to rediscover that spontaneity of my youth and to see how much the country I loved had changed. So last November I strapped on my knapsack, tent, and surfboard, recruited my friend Ben from New York to join me, and set off to become a wild pig again.

In 10 years, Tamarindo had changed from a sleepy fishing village into Costa Rica's booming surf hub: Internet cafés dot every corner, bars show 'Monday Night Football' live, and there are even a couple of sushi places. I expected to have to walk for a few days before finding vacant surf. But after just three hours we rounded a point north of Playa Avellana and saw something that stopped us in our tracks: peeling rights breaking off a rock reef – with not another surfer in sight. Back home in Southern California, I'd be battling 50 other surfers for waves like this.

Paddling out, I realized the surf was about eight feet, breaking fast and hard. As the first big set marched in, I took four strokes and was screaming along the face. I blasted through three long sections before the wave exploded in a mass of roiling whitewater. We surfed alone for two hours, sharing the break with only a string of low-flying pelicans that glided above the water.

This was obviously a fickle spot: Onshore winds and a rising tide junked up the waves just 10 minutes after we dried off. Had we been here an hour earlier, or later, we'd have never known this wave existed. It was a reward for walking, and, hopefully, a taste of what lay to our south.

As we hiked away from Avellana, the sand squishing between my toes as rough as a cat's tongue, my mind began to wander. For the first time in ages I had the luxury of thinking about absolutely nothing. The steady rhythm of my steps and the gentle tug of the backpack had me almost in a trance. Sometimes Ben and I talked. Other times it was quiet – only the crunch of shells under our bare feet and the shish-shish-shish of the sand. I had successfully broken the tethers of my wired life – no cell phone, e-mail, or fax machine. I had nowhere to be and plenty of time to get there.

Over the next few days the terrain changed from low, cactus-covered bluffs to bright green jungle to steep cliffs where iguanas scrambled up the sun-baked rocks. We awoke often to the screeching howler monkeys who patrol the treetops along the beach, like an eager, hairy cheerleading troupe. We appreciated the encouragement: I had estimated that we needed to do about seven miles a day but failed to account for the distance added by the countless nooks and crannies of the coast. In reality, we were logging close to 12 miles each hiking day – five to seven hours of walking. If the surf was up, we'd have a morning session; otherwise we'd try to make some mileage before the sun started to blaze. As sunset approached we surfed again and searched for choice camping spots. By 6:45 each night, we'd usually be zipped inside our mesh tents.

Along the way, we encountered stretches of nothingness peppered with thatch palapas, old fishermen's shacks, and sometimes a row of newly constructed mansions. After seeing how built-up Tamarindo had become and knowing that tourism in Costa Rica has increased by 85 percent since 1995, I expected the rest of the coast to be more developed. But we encountered a heartening lack of growth. Food and water were touch and go, so we carried granola bars, canned tuna, and water, and gorged on rice, beans, and grilled fish whenever we found a small restaurant. On average, we came across only about a dozen other humans a day – local fishermen, or ticos, commuting to work at nearby resorts, sometimes the odd traveler.

It wasn't long before we found ourselves sinking into a feral state. We realized that our gear was destined to be damp – whether from rain, sweat, or ocean spray – and our arms and legs were like armadillo skin, a composite of bug spray, sunscreen, and sand. Our inner thighs were chafed raw by the salt crystals caked inside our trunks, despite the bottle of medicated powder I'd poached from my son's diaper bag. But those discomforts paled beside the feeling of freedom. Every so often I'd stop and look back at our footsteps snaking along the coastline, and a sense of accomplishment would pour over me:

We'd literally walked as far as the eye could see. The view to the south was mostly the same: just a sweeping curve of sand and rock. Some might find the similarity monotonous – I thrived on it.In the late afternoon of day four we rounded a point and arrived at Playa Coco, about 35 miles from where we'd begun. A thunderstorm rumbled over the dark jungle, but shafts of sunlight broke through the clouds above the sea. The sunset had painted the sky a thick mix of deep orange, maroon, and yellow, turning the froth of the ocean blood red. It looked like a lost world, the Costa Rica I'd stored in my memory bank.

The waves were breaking head-high and freight-train fast. After walking most of the day I couldn't wait to surf this surreal seascape, so I paddled out and waited. Suddenly a large shadow skimmed below my dangling feet. Shark! I quickly laid flat on my board to get my legs out of the water. I scanned the surface for a dorsal fin or any other sign of movement. I noticed my breath – shallow, quick – and did my best to remain calm.

Just then a large set of waves on the horizon diverted my attention. I stroked frantically, hoping to duck-dive under them without getting slammed. The first wave reached me – easily a seven-foot face. I pushed my right foot on the tail of the board and slipped smoothly under. I continued scratching seaward just far enough to slide under the second wave. As I resurfaced I saw a third, even bigger. I turned and took two quick strokes. The peak jacked up and I jumped onto my board and raced along the undulating wall. I could see the water feathering out just over my head as the wave formed a hollow barrel behind me. No time for turns. I began pumping the board with my feet, trying to outrun the falling wall of water. After about five seconds, I pulled out in front of the wave with just enough space to kick out before it detonated in a thundering whoosh.

For the next two hours I rode perfect waves alone, until the sun had set and my arms felt like overcooked linguini. We decided, for the first time since leaving Tamarindo, that tomorrow morning we'd wake up and stay put.

The next day I sat on the beach eating the last of my granola bars when two gringo surfers waded into the ocean nearby. After not seeing another surfer for four days it was jarring.

"Where are you guys from?" I asked, knowing full well they were American.

"From here."

I must have shot back a puzzled look, because one of the guys explained: "I'm actually from the Florida Keys, but I live in Nosara. The waves aren't as good down there, but the real estate business is booming. It's the next Tamarindo."

The small talk continued and we soon found out that one of the guys, a 26-year-old named Brandon, was a real estate agent. He'd buy up large parcels of land from locals, then subdivide them and sell them to rich Americans. Mostly, though, he spent his days driving around with his scruffy dog searching for waves.

With his single-minded obsession for surf, Brandon reminded me of myself 10 years ago. Normally I'd be jealous of a guy like that, but now I, too, was living the dream. Watching the sun rise and set every day had rebooted my system, and I reveled in the raw simplicity of walking the coast. With every step we took and every wave we rode, my desk-jockey shell molted away, and I felt a youthful energy I hadn't sensed in years.

The surf was still pumping at Playa Coco a day and a half later, but we had to move on so Ben could catch his ride to the airport and I could meet up with photographer Corey Rich, who was joining me for the final leg of the journey. Corey quickly fell into my pace and we made good time, although at a crocodile-infested river mouth we had to borrow a rowboat to get across with all his gear.

One day around sunset, as we rounded a steep point near San Juanillo, our way was blocked by a 50-yard-long wall of vertical rock. The tide was coming in quickly and darkness was weighing heavy on the rocks. We had to find another way around.

We backtracked for 30 minutes in the darkness and found a tiny goat trail leading into the jungle. Peeling apart the green, we slipped through the thick vines. The path, singletrack and steep, looked as though it hadn't been used in years, and we got lost several times. The forest was alive with sound and constant movement – frogs croaking loudly, faceless birds screeching nearby.

Finally we found the skeleton of a house in a tight clearing and ducked under a fence and onto a narrow dirt road. I was muddy, sweaty, and bleeding from the rusty barbed wire.

"I can't remember whether or not I've had my tetanus shot recently," I said.

"It doesn't matter," Corey laughed. "It'll be days before lockjaw sets in."

We walked south on a dirt road in the pitch dark for three or four miles. No sign of humanity until, at the top of a steep hill ribbed with thick mud ruts, we saw a mirage shimmering in the distance: a small, warmly lit hotel. Before I knew it, we were soaking in a Jacuzzi, drinking ice-cold Pilsen beer, and peering out across the inky jungle toward Playa Ostional.

The next morning we trekked back to the beach and watched sea turtle hatchlings squirm in the sand and head for the sea. But ironically, we couldn't even surf – the nesting turtles meant ocean use was restricted, and locals and tourists were slowly filtering onto the beach to watch them. It was the highest concentration of humans I'd encountered on my entire journey, and it made me feel uneasy – almost claustrophobic.

Joe Walsh had agreed to pick us up the next morning in his speedboat and bring us back to Tamarindo. It required a grueling afternoon of hiking to get to the meeting spot, and the sand felt rock-hard under my tent that last night. But the hardness was familiar and oddly comforting. I watched a pair of shooting stars streak across the sky through the mesh ceiling, then focused my headlamp on a pair of well-worn photos I carried in my pack: one of my wife, Ilene, the other my son, Luke. Although they were thousands of miles away and I hadn't spoken to them in a week, I somehow felt closer to them than before. I turned off my headlamp and let the waves lull me to sleep.

Around noon the next day Walsh's boat came gliding over the horizon and anchored just beyond where the waves were breaking. We paddled our gear out to the boat – duck-diving under the waves with waterproof packs strapped to our backs. By the time we finished loading the boat, the tide was dropping, and the wind suddenly turned offshore. It seemed the Pacific was offering me one last gift. So along with Joe and his boat captain, Rodrigo, I savored the shoulder-high surf. The bathtub-warm ocean felt thick and viscous, almost embracing me as I paddled.

Later, as we sped toward Tamarindo a couple of hours away, I sat near the bow and gazed at the shoreline that had challenged me over the past nine days. Instead of the obstacle course of rocky points, river mouths, and sandy swatches, it looked almost inconsequential, blended together into a flat green and brown backdrop. The breaks we'd surfed looked like anonymous blurs of whitewater.

"Well, the good news is we just surfed great waves all by ourselves," Joe yelled over the roaring engine. "The bad news is we may not have enough gas to make it all the way back to Tamarindo."

"No worries," I said, chuckling. "We can always walk."