On the cliffs outside Cannes sits a row of green cabanas, a resting place for the millionaire guests at a five-star resort. The cabanas are open-fronted, rickety, at the mercy of the elements. In mild weather they must be heaven, but when the wind is up and the waves are lashing, a berth in the cabana becomes an ongoing purgatory. Michael Douglas has his hair in his face, and the collar of his jacket has turned inside-out. He is clutching at the table like Captain Ahab at the rail of his ship. It is a wonder he hasn't already been blown out to sea.

In August 2010 Douglas walked on to the David Letterman show to confirm that he was suffering from throat cancer, that the disease was at stage four and that stage five was death. Tributes were polished and obituaries prepared. That he is even here in Cannes is cause for celebration. The fact that he comes with what is surely his boldest, most exhilarating role to date qualifies him as some kind of Lazarus.

Directed by Steven Soderbergh for American TV, Behind the Candelabra is a tart, terrific biopic of Liberace and his lover Scott Thorson, who doubled as the pianist's brocaded chauffeur. Over the past few decades, the world has witnessed Douglas in a variety of guises, not all of his choosing. In his youth he was cast as the son of Kirk, a gilded Hollywood dauphin; in later life as the sugar-daddy husband of Catherine Zeta-Jones. He has been a master of the universe in Wall Street, furtive female prey in Fatal Attraction and Basic Instinct, and Mr Average in crisis in the underrated Falling Down. None of these roles, though, prepared us for his explosive turn as Liberace, the darling of middle America who died as a result of Aids in 1987. Douglas conjures the man in all his camp and trashy glory; his teeth a-dazzle, his eyes like glass beads. It is a peach of a role and he gobbles it whole.

"I met him once in passing," the actor recalls. "My father had a weekend house in Palm Springs and I remember driving out and we came to this cross-section and this Rolls-Royce convertible pulled up alongside. It was a sunny day and, my God, the reflections were bouncing off his gold jewellery and diamond rings and his hair was perfectly coiffed." He shrugs. "Of course, we now know that he was wearing a wig."

If Douglas wore a wig, it would be long gone by now. His grey hair is all over the place; the wind is molesting him from every direction. But so what, who cares? Behind the Candelabra, he says, arrived at the perfect moment. Various things had been going wrong. First, his son Cameron was sentenced to five years in a federal prison for selling crystal meth; then the cancer right on the back of that. But he loved working with Soderbergh, and he relished working with Matt Damon, who co-stars as Thorson. Plus the role itself was too good to refuse. "Coming out of all those personal issues, to be offered a part like this." He shakes his head. "It's like nirvana."

Following the diagnosis, Douglas subjected himself to two months of chemotherapy and radiation, a draining, exhausting process that made him lose more than 13.5kg (30lb). Today, however, he looks OK: whippy, bright-eyed and only a little slack around the jawline. He has just come from lunch and is easing back towards his fighting weight.

How is his health right now? "Good, thanks. I have to check in regularly – now it's every six months – but I'm more than two years clear. And with this kind of cancer, 95% of the time it doesn't come back."

It was looking pretty black for a while there. "Yeah, well. Stage-four cancer and a shit-pot of chemo and radiation. That's a rough ride, that can really take it out of you. Plus, the amount of chemo I was getting, it zaps all the good stuff too. It made me very weak." Never, he insists, did he entertain the prospect of dying. He gritted his teeth and hoped for the best.

Douglas in The Streets Of San Francisco, 1972. Photograph: Moviestore Collection/Rex Features

This, perhaps, is how he has always gone at things: headlong, with a minimum of introspection. For all his Hollywood pedigree, Douglas has always retained a curiously muttish, streetwise air, as though he takes his lead from the ghosts of his ancestors; dirt-poor Jewish immigrants from Belarus. Or possibly it is the result of being raised outside Los Angeles.

"My mother and father met at the American Academy of Dramatic Arts," he says. "He was a senior and she was a junior and their marriage didn't last very long. Lauren Bacall was responsible for bringing him out to Hollywood and I was four and he just started messing around so much that my mother said: 'I'm out of here.' So I grew up in New York City and Connecticut, where she remarried. I was fortunate to have a great stepfather and a lifestyle that was nothing to do with Hollywood. I'd see my dad at holidays." He pulls a face. "But that's nice to hear. Most of the stories I read are about my Hollywood pedigree."

By his late 20s, though, Douglas was already quite the prince, playing a heartthrob cop in The Streets of San Francisco and producing the multi-Oscar-winning One Flew Over the Cuckoo's Nest (a long-cherished project of his father's). Yet Douglas points out that real stardom came relatively late, when he was nudging middle age, with the gaudy double-header of Fatal Attraction and Wall Street.

The 80s were to prove his happy hunting ground, the decade that most chimed with the man's persona. There is an ambivalent quality to Douglas's best-known characters and our response to them is ambivalent as well. As film historian David Thomson points out, his speciality were heroes who are "morally indolent, compromised and greedy for illicit sensation". Yet, by dint of being heroes, there was something glamorous about them too. As faithless Dan Gallagher in Fatal Attraction, wayward Nick Curran in Basic Instinct, or pinstriped Gordon Gekko in Wall Street, he managed to be at once virile and venal, authoritative and shifty, a strutting success story and a signpost to disaster. Douglas had the hard, slotted mouth and the hungry, crawling gaze. He was the perfect 80s movie star, an emblem of American avarice, beloved of all the housewives. Mike Leigh's 1988 comedy High Hopes contains a scene in which a suburban shrew attempts to cajole her boorish husband into some sexual role-play. "You're Michael Douglas," she instructs him. "And I'm a virgin."

I am betting he would not have dreamed of playing Liberace back then. "Probably not," he concedes. "But that's as much to do with the times as it is about my stardom. A lot has changed in the past five years."

I ask whether he thinks it remains a taboo, the notion of an A-list Hollywood actor playing a gay role. He seems to be in two minds. No, he says, absolutely not, at least not any more. On the other hand, my God, it is a brave thing to do. "That's why I take my hat off to Matt, you know, going from John Bourne to this. Is that right? Is Bourne's first name John?"

I'm not sure; it might be Jason? "Well OK, from Jason Bourne to this. At the height of his career, the fact that he's willing to play a part like Scott – that shows he's an admirable guy who's taking chances."

In 2000 Douglas married Zeta-Jones, Swansea-born and exactly 25 years his junior (they share the same birthday). Their relationship has played out in the press as a tinny, 21st-century retread of Liz Taylor and Richard Burton – the Hollywood insider and the Welsh upstart, with the gender roles reversed. The forecasts were stormy but the marriage has lasted. They have two children together.

In the past, Douglas has said that shuttling between his home in Connecticut and his father's base in LA turned him into a chameleon, able to adapt but unable to settle, and that this turned out to be solid training for his life as a film star. More recently, Zeta-Jones has discussed her own tussles with a high-vaulting emotional state that was subsequently diagnosed as bipolar disorder. Both of them found each other and both of them found acting – which is either outlet or symptom, depending on your stance.

Douglas with Glenn Close in Fatal Attraction, 1987. Photograph: Rex Feat/Moviestore Collection/Rex Features

"Oh, I think it's an outlet," Douglas says. "But Catherine's situation is different to mine. She started so young. She was doing Annie when she was 10, I don't even know how much of a childhood she had. She was working in 42nd Street in the West End when she was 15, 16." He thinks it over. "I don't have that part to my character, so it's difficult to say. But acting requires a lot of energy. It pumps you up and there's a lot of bouncing between these different parts. And when you come home, you have to sit down, take a bath and let it go. I think that's maybe the difference between us."

On screen, he plays dreamers and schemers: men with prodigious appetites and a wonky moral compass. Off screen, too, he has had his vices. In 1992, at the peak of his fame, he checked into rehab for treatment for drug and alcohol dependency.

The throat cancer, I assume, was first seeded during those wild middle years, when he drank like a fish and smoked like the devil. Looking back, knowing what he knows now, does he feel he overloaded his system?

"No," he says. "No. Because, without wanting to get too specific, this particular cancer is caused by HPV [human papillomavirus], which actually comes about from cunnilingus."

"From cunnilingus. I mean, I did worry if the stress caused by my son's incarceration didn't help trigger it. But yeah, it's a sexually transmitted disease that causes cancer." He shrugs. "And if you have it, cunnilingus is also the best cure for it."

Right, I say. OK. So what he is suggesting is that it all evens out? "That's right," says Douglas. "It giveth and it taketh."

Behind the Candelabra opens with Liberace in his pomp, the highest-earning entertainer of his era. The picture comes bathed in golden hues, as though it has been sitting for too long under the sun-lamp, and its subject is padding around his mansion like some ghastly combination of Baby Jane, Michael Jackson and the emperor Nero. The first half is barbed and biting, an outrageous comedy of American grotesques. But what nudges Soderbergh's film towards greatness is the way it takes these Day-Glo caricatures – leering Liberace; lunkish Scott – and humanises them, spinning a believable love story out of the rhinestones and facepaint. Near the end, Liberace is winding down. None of it – the props, lies and illusions – can provide cover against the disease that is now beating against him.

Shooting the role was exhausting and cathartic, particularly given Douglas's own circumstances. He explains that the film was initially scheduled to go before the cameras earlier, when he had just completed treatment. "There was a year's gap between when we thought we were going to shoot it and when we actually did. The whole thing kept getting postponed. And me, as paranoid as I am, thought it was never going to happen. But in truth I think they were just being kind to me. They knew I wasn't ready. I didn't know. They knew, and they were right. As soon as I got on set I thought: 'Man, I never would have been able to do this a year ago, it would have finished me off.' As it was, it proved very healing."

At 68, Douglas says that, by and large, he can look back with pride. He has had a good run at the movies, not too many turkeys in the coop. He is glad to be married and delighted to have a young family again; he never imagined that would happen. "It's been a rough few years, the cancer break. But I'm back with a vengeance. I feel blessed and fortunate that I still have a career. I feel blessed and fortunate that I'm even alive."

We leave the cabana and walk back towards dry land. The actor is talking about the Monaco Grand Prix, about how he prefers watching sport to watching movies, because you can never tell how it's going to end. I'm still thinking about what he said earlier, about HPV and oral sex and how it can be both cause and cure. Can that last bit be right? A doctor the Guardian later speaks to insists it makes no sense. I had hoped it could be true; it sounded oddly karmic. Douglas has lived not wisely and perhaps not even well – but certainly to the full. He has drunk and smoked and snorted, and had plenty of sex. His appetites brought him to the brink of disaster. It would be nice if they could now be his salvation too.