A man who wishes to become a woman — who has already undergone all of the necessary procedures except for The Big One — learns, on the eve of the operation, that he fathered a child 18 years ago, and that this child is now trying to find him. The child is unaware, of course, that his long-lost father is about to become his mother.

Neil Simon could make a merry farce of such a scenario. But “Transamerica” is a much more down-to-earth comedy, one with heart and soul. It wants us to laugh at its witty dialogue, but it doesn’t want us to laugh at its protagonist or her situation.

“Transamerica” isn’t the best film of the year, but it certainly contains one of the best performances: Felicity Huffman, recently an Emmy-winner for “Desperate Housewives,” now deserving of more nominations for playing Bree Osbourne. Bree was raised as a man but now, as she approaches 40, is about to become a woman. She has already been living as one for some time, taking hormones, working on pitching her voice higher, undergoing electrolysis and other small-scale surgeries to take the man out of her. All that remains is a certain crucial procedure and then she will officially be a lady.

I’m already calling her “she,” even though she is technically still a man — or, in the correct terms, a pre-operative male-to-female transsexual. “She” is the easier pronoun to use, partly because she is played by a woman, and partly because that’s the term Bree herself would prefer. In fact, most people she encounters don’t realize she still has boy parts.

I haven’t even begun to tell you the plot, but I have to stop to tell you about how brilliantly cast Huffman is. I don’t know if she’ll take this as a compliment, but the role of a pre-op MTF tranny is the part she was born to play. A woman who was supermodel-gorgeous couldn’t have played Bree; you wouldn’t have believed she had ever been a man. But Huffman, while good-looking, has facial features that are not “petite” or “girlish.” With the right wig and makeup, they take on a certain masculine quality. Between that and her voice, which she alters to sound higher than a man’s but lower than a woman’s, she honest-to-goodness passes for someone who has just walked down Male Avenue and is rounding the corner onto Woman Boulevard. When we catch an unfortunate glimpse of Bree’s soon-to-be-inverted apparatus (courtesy of prosthetics), you forget for a second that Felicity Huffman doesn’t actually have a penis.

(Oh please oh please oh please let them quote that last sentence in the ads!)

But back to the story. A week before the operation in Los Angeles, Bree learns that her one heterosexual dalliance in college produced a son, who is now 17 and in jail in New York. His mother is dead. He wants to find his father. Bree isn’t ready to accept that she has a son, in large part because he will serve as a reminder of her former life. But her psychiatrist, Margaret (Elizabeth Peña), insists that Bree deal with this bit of baggage before she make the final move into womanhood.

Bree finds the kid in New York. His name is Toby (Kevin Zegers), and he has been living on the streets working as a gay hustler, though whether he’s actually gay remains to be seen. Toby and the people at the correctional facility assume Bree is one of the local church ladies who go around rescuing lost young people, and Bree lets them think that.

Because Toby wants to get to L.A. to find a job in the film industry, and because Bree has to get back there anyway, they take a cross-country road trip. I don’t buy this, exactly — it would have been much cheaper to simply buy Toby a plane ticket — but it gives them plenty of time to get to know each other, learn each other’s secrets, and develop a bond.

Bree is well-educated and speaks with impeccable grammar and vocabulary. (On learning that Toby makes his living as a prostitute, she asks, “How much money did you make per … assignation?”) Toby comports himself with a slouchy casualness befitting a street urchin, and when they run out of cash, he knows how to make a quick hundred bucks at a truck stop. They are Oscar and Felix for the new century.

Huffman gives the character more dignity and grace than most films would, and though writer/director Duncan Tucker acknowledges Bree’s freakishness, he doesn’t hold her up to ridicule. He doesn’t make her out to be a saint or martyr, either, which is nice; she’s simply human, like the rest of us.

A turning point for Toby’s perception of her, after he’s figured out that “she” is only partially correct as a pronoun to describe her, is when they meet a man named Calvin (Graham Greene) at a roadside diner. Calvin is a gentleman with cowboy manners, tipping his hat and opening doors for Bree. It’s the first time she’s been treated like a lady. Toby takes Calvin aside and tells him Bree has secrets. Calvin says, “Every woman’s entitled to a little mystery.” He’s not perfect either, he points out.

There is an encounter with Bree’s parents (Fionnula Flanagan and Burt Young) that brings together the film’s greatest strengths but also introduces its chief flaw: The sequence is funny and emotionally dynamic, but it’s also over the top. Flanagan’s version of Bree’s histrionic, conflicted mother suggests real crises of emotion that have been overplayed into big, silly tantrums.

The rest of the film, though, is surprisingly centered and calm, neither exploiting the story’s sensational aspects nor ignoring them. It finds comedy and drama in the same places, often at the same time, and it very ably makes Bree — so far-removed from most of us in many ways — seem like someone you might have known once.

B (1 hr., 43 min.; R, a lot of harsh profanity, some sexuality and sexual dialogue, some skinny-dipping and other non-sexual nudity.)