I love Barcelona but sometimes you have got to get out of town. Sitges? Lovely, but it can be as rammed as the Ramblas. The Pyrenees? Yes, but in summer I need a beach! OK then, the Costa Brava. But have you seen the queue of cars down to the “secret” beach that only grandma Lola knows about?

Hmm, perhaps the city’s not so bad. Barceloneta beach is just 10 minutes from the centre and there’s at least 10 square centimetres of sand per person.

Or you could do what the Barcelonians, but few foreign tourists, do and head to the Costa Maresme, which stretches north-east for 30 miles or so from just outside the city to the start of the Costa Brava at Blanes.

My favourite section is the seven miles between Caldes d’Estrac and Sant Pol de Mar.

Take the train; the journey is less than an hour from Placa Catalunya, costs just over EUR3 (Dh12) (see transport details at end), and is a great bit of time travel.

The line, opened from 1848, was the first railway on the Iberian peninsula and was the making of the Maresme as wealthy folk from Barcelona built fancy summer homes. The track hugs the coast - on a stormy winter’s day it feels like a large wave and a startled octopus could land in your lap - and defines the little towns along here because it cuts right through them, often running between homes and the beach.

The ride gives an unrivalled view of one of the costa’s big selling points, its miles of wide, golden, sandy beaches. No wincingly painful pebbles of the Costa Brava here; or playing sardinas - the Maresme also has a lot more space. The beaches are family-friendly, with many play areas and activities. There are railway stations every few kilometres and you can hop up and down the coast for a few euros.

Caldes d’Estrac (also known as Calderetes) is a gem of a place. This spa town (the clue’s in the name) couldn’t be less of a show-off if it tried. Its main road winds up from the beach (ignore that thundering 1960s road flyover) past restaurants and delis to the jewel in the crown, Fundacio Palau (EUR5), which is dedicated to one man’s long friendship with Pablo Picasso.

Josep Palau i Fabre hoarded evidence of their relationship and the collection includes notes between the two men and dozens of scribbles, drawings and paintings by the artist. The 19th-century council-owned Balneari Caldes d’Estrac has a range of spa treatments from EUR11.

The unmissable place to eat in town, El Jardi del Vellard, used to be in a tiny place right in the centre, but it was immensely popular and burst out of its seams earlier this year. Its new larger home is a 10-minute walk gently uphill. Chef Ruben Calvo used to work at three-Michelin-starred Sant Pau in Sant Pol de Mar (see below) and he brings some of that restaurant’s flair and imagination here - while being careful not to challenge his customers’ palates and budgets too far.

Set lunch during the week is EUR14.

Appealing small hotels and guesthouses are thin on the ground in the Maresme as most holiday accommodation is in apartments. That’s what makes Caldescans (doubles from EUR95 B&B) such a find. It’s right next to the Fundacio in a charming 19th-century building that used to be the Danish consulate when diplomats moved from Barcelona to Caldes during the civil war. There are just four rooms, each given a 1960s design spin.

Arenys de Mar is what passes for the big smoke in these parts - and not just because it’s the birthplace of Chelsea midfielder Cesc Fabregas. It’s a bustling place, especially on Saturdays when market stalls line the main drag.

The splendid modernista market building is open the rest of the week. A big fishing fleet is based here and simple Restaurant Els Pescadors “La Llotja” is next to the fish market, just metres from where the daily catch is landed. I had probably my best ever fideua (seafood noodles) here, surrounded by locals gorging on the freshest fish and shellfish. Expect to pay around EUR60 for two.

Arenys makes a good place to stay for a few days on the Maresme, particularly now that the town’s first hotel has just opened. Elegantly designed Vila Arenys Hotel has doubles from EUR80 B&B, but I’d be tempted to pay a bit more for one of the two rooms with its own terrace and hot tub.

At Canet de Mar you can really see how the newly rich of booming 19th-century Barcelona fell in love with the Maresme and made it their (second) home. The town has an extraordinary set of modernista buildings, including the summer residence of Lluis Domenech i Montaner, architect of the Palau de la Musica in Barcelona. It is now a museum (EUR3) which organises guided walks taking in Canet’s modernista heritage. An hour’s walk to the top of Pedracastell hill above the town not only has amazing views but also takes you past Domenech i Montaner’s fantastical castle of Santa Florentina (castelldesantaflorentina.com) which features in Game of Thrones.

Finally, pretty, sleepy Sant Pol de Mar.

Wander its winding lanes, or spend time on the beach.

So that’s the Maresme. Perfect as a base for a beach holiday, with quick trips into Barcelona, or as a place to unwind for a few days after a city break. I’m sure the Barcelonians won’t mind you being let into their little secret.

The Costa Maresme lies on the R1 line from central Barcelona. A four-zone T10 ticket, which is for 10 journeys and covers the stretch from Barcelona to Sant Pol de Mar, costs EUR34.45.

A one-zone T10, valid for just the Costa Maresme, costs EUR9.95.