The Blue Coast train is the very best way to see the dramatic landscape west and north of Marseille, with its rugged hills and tiny villages snuggled in deep limestone calanques.
Click here to book a hotel in Marseille
The rugged terrain here forces the road to loop sharply inland. The railway line, on the other hand, hugs the coast closely, often with a steep drop down to the sea, as it passes through 23 tunnels and 18 spectacular viaducts representing a stupendous feat of engineering.
Supervised by Paul Séjourné, work began on the line in 1907 and was completed in 1915; an older, single-track line previously existed on a small portion of the route, from Port de Bouc to Miramas.
Over 14 trains a day in each direction run all year round (the line is used by lucky local commuters travelling to work in Marseille). For a pittance, the route also affords tourists one of the most beautiful rail journeys in all of France.
The current timetable for the Blue Coast train can be downloaded from the SNCF TER (French regional railways) website (in French only). Select timetable no.7 (Marseille-Miramas) from the drop-down menu.
When booking the train, be sure to take the Côte Bleue (Blue Coast) line via Port de Bouc as there is an alternative, much less attractive inland route from Marseille to Miramas via Vitrolles.
It's always wise prior to travel to check that the train you plan to catch is actually running, as the French rail network is very susceptible to strikes, delays, breakdowns and cancellations, sometimes for no apparent reason. In fact the TER (regional train) network in Provence has one of the worst records in France in this respect.
Many areas of the SNCF website are in French only but are not too difficult to understand. "Supprimé" is "cancelled", "interrompu" or "perturbé" is "disrupted", "panne" is a breakdown, "delai" or "retard" is a delay and "grève" or "mouvement social" is strike action.
A French rail ticket has to be validated (composté) prior to travel by punching it in the machine at the entrance to the platform.
Sit on the left - if you are boarding the train in Marseille - for the gorgeous sea views, but look across to the right now and again for some equally lovely glimpses of the rocky hinterland.
The first five or ten minutes of the route are an unremarkable run through the scruffy northern outskirts of Marseille. The first stop is a new station, inaugurated in 2014: Arenc-Euroméditerranée.
It's designed primarily to serve this very fast-expending commercial district of Marseille, but is also potentially convenient if you are staying in the Joliette area or starting or ending your journey at the cruise ship port or ferry terminals.
As the train pulls out of the second stop, L'Estaque (the station is high on a hill on the outskirts of the city), you have a breathtaking view across the bay to Marseille.
Apart from a couple of modern apartment blocks, the tumble of red pantiled roofs in the foreground barely seems changed from the vistas that attracted Paul Cézanne there again and again (pictured: Le Golfe de Marseille, vu de L'Estaque, 1886-1890).
The most picturesque part of the route follows, with views into tiny coves and the Blue Coast calanques between Niolon, Ensuès la Redonne and Carry le Rouet. The photograph below was taken on this part of the route.
All the stations are built in a similar style, with a red and green tiled detail along the cornice. Some are better maintained than others: the beautiful ironwork at L'Estaque is sadly neglected, though the station at Sausset les Pins was given a sparkling facelift in 2012.
Very good news: thanks to the efforts of dedicated local activists and conservationists, L'Estaque station was officially declared a national Historic Monument in 2012, in spite of its bad state of repair. It's the only station with this distinction in the whole of Provence-Alpes-Côte-D'Azur (apart from a section of Nice railway station).
This means that that funds have been released to restore the tiling, glass and ironwork. Being Provence, this is happening slowly. Very, very slowly.
But the work has finally begun and some parts of the station have been beautfully renovated. Others are as scruffy as ever and it won't be completed for a long time. But at least it won't (we're told) interrupt the train service.
In Carry, you can stroll down to the port and take a boat along the Côte Bleue. The best beaches on the Blue Coast are to be found west of Carry, amid the pine woods of Sausset les Pins, La Couronne and Carro.
Often described as the "Venice of the Mediterranean," Martigues, with its charming squares and streets and brightly-painted houses, has just one canal, but it is undeniably a very picturesque one.
The station, however, is a 45-minute walk from the centre (there is a local bus into town, but it doesn't connect directly with the train timetable).
So if you specifically want to visit Martigues, you are advised to go by bus from either Aix en Provence or Marseille rather than take the train.
Even if you're just passing through, watch out from the train window for the remarkable swivelling Viaduct of Caronte, built in 1914, blown up by the Nazis in 1944 and rebuilt in 1954 (the original bridge can be glimpsed briefly in Jean Renoir's 1935 film Toni).
You will also enjoy panoramic views of the town, its marinas and the Berre Lake (on the right as the train pulls out of Martigues towards Miramas).
From here on the landscape becomes industrialised, with the oil refineries of Port de Bouc and Fos sur Mer, then the line briefly skirts the Berre Lake before arriving at Miramas, the last stop.
This is a major rail junction from where you can either catch a connection on to Arles or Avignon, or take a short cab or bus ride up the hill to Miramas le Vieux, a classic, pretty - if rather sleepy - mediaeval village perché (hilltop village) offering 360 degree vistas across the surrounding landscape.
Watch out in summer (from July to the end of September) for special deals on combination day tickets.
The "Albatross" combines a train ride and mini boat cruise: you catch the train to Carry le Rouet, where you take a 75-minute boat trip along the western calanques before returning to Marseille by train. The "Bermuda" is a pass that enables you to take as many trips along the Blue Coast line as you want in a single day.
And each year at the beginning of October, Miramas station holds a one-day Fête du Train (Train Festival). Special trains run along the Blue Coast Line - and sometimes the Avignon-Miramas one - and the event is perfect both for train enthusiasts and for families.