The third installment of director Michael Winterbottom’s improvisational “Trip” series, in which Steve Coogan and Rob Brydon play semi-fictionalized versions of themselves, is as humorous as the previous two—the first of which followed them touring Northern England and the second Italy—but its moments of darkness are deeper than those in the earlier films. It also has an ending almost insured to make your jaw drop—whether in anger or amazement will depend on you; but whichever it is, you’re unlikely to forget it, or not want to debate it.

Like the two earlier pictures, this is a shortened version of a six-part television series (edited by Mags Arnold, Paul Monaghan and Marc Richardson). It wastes no time getting started, simply having Coogan call Brydon to ask whether he wants to go to Spain and drive around the country sampling the cuisine for some newspaper reviews. Brydon, a happily married but obviously harried family man, needs only take one look at his screaming baby son to say yes. Quickly packing, he’s picked up by Coogan and they’re off to the ferry, on which Coogan gets the better compartment but, typically, also a case of seasickness.

After the two reach Spain, much of what follows takes the normal pattern. They drive endlessly across amazingly beautiful terrain, stay at gorgeous hotels and eat succulent dishes at every stop. (Kudos to James Clark for photographing it so well.) They sing pop songs—most notably “The Windmills of Your Mind,” which fits in with a Don Quixote motif (Coogan is always talking about Cervantes, as well as other tidbits of Spanish history, as well as showing off his knowledge of the language); in fact, at one point the duo dress up as Quixote and Sancho Panza for an absurd publicity shot—and Brydon talks of doing a stage revival of “Man of La Mancha.” They badger one another endlessly, with Brydon’s exasperation at Coogan’s repeated references to “Philomena” increasingly waspish, and continually try to outdo one another in shows of wit.

Of course they both also offer impersonations, some (Michael Caine, Al Pacino, Sean Connery) repeats from previous installments but many new (hilarious Mick Jaggers from both), including some that are comparatively esoteric and especially good (Coogan does a superb John Hurt and Michael Hordern). Naturally, they also return to a specialty—Roger Moore, especially appropriate when Coogan is discussing the Moors and their surprisingly tolerant rule in medieval Iberia. That historical information becomes key to the ending of the picture, when Coogan goes to North Africa after Brydon has left for home, and there finds not the romance and adventure he was hoping for, but instead comes face to face with a modern reality. “Let’s stop talking about ISIS,” Brydon had said not long before. It turns out, though, that not talking about it doesn’t make it disappear.

The dark final moments are of a piece with the melancholy undertones of the film. While Brydon appears rather well adjusted in his life—even though he speaks disparagingly of Jagger fathering a child in his seventies even though Brydon himself, at fifty, has young kids (he insists that they stop at a dinosaur-related tourist spot so he can take photos for his daughter)—Coogan is in the throes of perpetual crisis. His personal life is a mess—he dreams of a relationship with a married actress, but she puts him off with a bit of surprising news. His son, who is supposed to join him for the last leg of the trip, cancels out with an announcement that throws him. And professionally he’s faring no better—not only is his script for a new picture (which Brydon notes has a suspicious similarity to “Philomena”) facing the a rewrite by an “up-and-coming” (read younger) fellow, but his agent has quit and started a new firm without even telling him, or asking if he wants to continue their association.

It all comes down to his feeling old, and the fear of mortality—stronger than the intimations of it in “The Trip to Italy”–explains his bursts of bitterness as well as his determination to fight it with a show of creative bravado that seems more imagined than real. He insists that he’s going to use the journey as the basis for a book modeled on classics of the travel genre, a vague attempt of reinvention that actually suggests, like his film script, a dependence on a past model. That’s why the pair’s meeting with an itinerant young English guitarist, who reminds Coogan of the life he wishes he could have, now causes him such pain. More than in the first two installments, there’s poignancy as well as humor at work in “The Trip to Spain,” and by the close it gives the film a more serious underpinning.

That doesn’t stop it, however, from being a visually luscious travelogue and a savory introduction to upscale Spanish cuisine, as well as another delicious joint comedic routine by two masters. In a summer of dreary sequels, here’s one that is winningly familiar yet different enough to make it stand out from the others. Let’s hope there are more courses in this cinematic feast despite an ending that suggests there might not be.