In Salvador Dalí's portrait of Luis Buñuel, the film-maker has a powerful, pugnacious face. He is clearly an authoritative character, someone to be reckoned with.

Today, it is interesting to ask which of them was the true artist. Perhaps Dalí's admiring portrait is a clue.

These friends who met as students made two hilarious, outrageous avant-garde films together, Un Chien Andalou and L'Age d'Or. They were part of the surrealist movement led by André Breton in Paris between the world wars, and the sequence in Un Chien Andalou when a cloud crossing the moon is intercut with a razor slicing through an eyeball has become perhaps the most infamous of all surrealist dream images.

In the 1930s, these brilliant collaborators grew apart. In his memoir My Last Sigh, Buñuel expresses contempt for Dalí's financial greed and dalliance with the political right. While Dalí painted portraits of the rich and eventually returned to Franco's Spain to create a megalomaniac museum of himself and paint kitsch religious art, Buñuel, based in Mexico, made in his later years a string of radical, disturbing and intelligent films.

I recently watched The Exterminating Angel, which he filmed in Mexico in 1962. It is one of the most disconcertingly profound films ever made. A posh dinner party in a grandiose mansion goes horribly wrong when the guests find they cannot leave. They have not been walled in; they are not being held hostage. Life outside the house goes on as usual. The party of eminent and wealthy people in evening dress simply do not believe they can exit the room.

It is – well, it's surreal. Buñuel never abandoned the aesthetic of the irrational. Rather, he honed and perfected it over a lifetime. The guests in The Exterminating Angel are in the grip of a collective delusion that is never explained. They act accordingly, and the film's power lies in the logical ways these people respond to an illogical belief. They gradually accept they are all going to die, and the film becomes a cross between a disaster movie and Géricault's painting The Raft of the Medusa. No film has ever dramatised with such insight a group of people confronting their own mortality – the parents who realise they will never see their children again, the lovers dying in one anothers' arms ... And yet it is all ironic; it is all a joke.

This film is devastating, like the greatest art is devastating. It is one of a sequence of equally great films that Buñuel made in the 1960s. Can any of Dalí's late paintings be called "great"? Can any of his early ones, come to that?

We live in an age of multimedia art and yet, when it comes to the history of modernism, the same museums that show the grooviest contemporary works are remarkably staid. The finesse of Dalí's paintings still keeps him at the forefront of official art history. Tate Modern had a show about Dalí and film. Instead it should have an exhibition about Buñuel and art: for Buñuel's films endure as great art in a way that Dalí's paintings do not.