Music obviously plays a large role in the production of a film. For example, horror movie scores can be even scarier than the films themselves, and popular music played over end credits can conclude a film on a joyous note. A movie's score is obviously important, but just as important are the pre-recorded songs that it can use throughout.

RELATED: 10 Best Songs From Teen Movie Soundtracks

Great song placement can elevate both the film and the song itself, creating an enjoyable hybrid experience of audio and visual. Arguably, song choice is most important in the end credits, and the perfect final song means that a movie will end on an unforgettable note.

"Mad World" - Michael Andrews & Gary Jules (Donnie Darko)

Donnie Darko walking in a trance.

Donnie Darko is one of those movies that will never stop being discussed. It is the subject of countless Reddit fan theories, and many people believe it to be one of Jake Gyllenhaal's greatest performances.

Of course, the music also helps. Michael Andrews and Gary Jules' "Mad World" was made specifically for the film, and while it has transcended the movie to become a popular song in its own right, it will forever be associated with Donnie Darko. The song perfectly fits the morose tone of the movie and helps end it on a suitably dour note.

"Lose Yourself" - Eminem (8 Mile)

Jimmy rides a bus in 8 Mile

Eminem was on top of the world in the early 2000s, and this included when he penned the iconic, "Lose Yourself." Like "Mad World," "Lose Yourself" was written specifically for 8 Mile, but it transcended the movie to become a celebrated piece of pop culture in its own right.

RELATED: The 10 Greatest Movies About Music, Ranked (According To IMDb)

The song preceded the film by a couple of weeks, and it understandably helped generate interest. It was an instant hit, and hearing it play over the credits of 8 Mile served as one of Eminem's greatest creative accomplishments. A surprisingly good movie was followed by one of the most well-known rap songs ever written.

"Coconut" - Nilsson (Reservoir Dogs)

The thieves from Reservoir Dogs walking in an alley.

Quentin Tarantino certainly has an ear for music. Not only do his movies contain some of the best uses of Ennio Morricone music, but his soundtracks are always unforgettable. He knows exactly where to place a song, how it will work in regards to story and tone, and he also has a penchant for reviving long-forgotten songs.

Case in point, ending his debut film Reservoir Dogs with Nilsson's "Coconut," a song that reached #8 in 1972. Not only did the quiet calypso song serve as a surprising tonal clash with the loud and violent events on screen, but it established Tarantino's love for '70s music.

"Iron Man" - Black Sabbath (Iron Man)

Tony Stark raising a prototype gauntlet in Iron Man 2008

Yes, ending Iron Man with Black Sabbath's "Iron Man" was very obvious and very on-the-nose. But regardless, it somehow worked. The ending helps prove that Iron Man is the best, and it ends his movie with a suitably loud and badass tune.

The way Tony Stark nonchalantly reveals his identity as Iron Man, combined with the thrilling sounds of Black Sabbath, made for an effective ending to one of the greatest superhero movies ever. It was a brash and roaring ending, signaling the confidence of the newfound MCU.

"Paint It Black" - The Rolling Stones (Full Metal Jacket)

The soldiers sing the Mickey Mouse March at the end of Full Metal Jacket

What better way to end a Stanley Kubrick masterpiece than with The Rolling Stones? Kubrick had a knack for well-placed music, and this is arguably his greatest auditory achievement. Full Metal Jacket is one of the best war movies of all time, and certainly one of the most pessimistic, so by ending his tragic tale with "Paint It Black," Kubrick is making a dour thematic statement.

The juxtaposition between "Mickey Mouse March" and "Paint It Black" is nothing short of brilliant, and the song's lyrics pair well with the movie's themes and messages.

"Baby You're A Rich Man" - The Beatles (The Social Network)

Mark Zuckerberg in a deposition in The Social Network

The Beatles' music has been used well throughout film and TV history, but perhaps the greatest use of their music can be found at the end of The Social Network. As Mark desperately begins refreshing the friend request he sent to Erica Albright, the wonderful sounds of The Beatles' "Baby You're a Rich Man" begin to play.

The calm sound of the song pairs well with the movie's rather downbeat ending, but the greatest link can be found in its lyrics. Mark Zuckerberg is now a rich man, but he's not necessarily a happy one.

"Extreme Ways" - Moby (The Bourne Supremacy)

Jason Bourne aiming a gun.

The Bourne Supremacy is arguably the least liked entry in the initial Bourne trilogy, but it features its greatest ending. To taunt Pam and let her know that he is watching, Bourne tells her that she looks tired, prompting her to freak out and look around in a panic.

RELATED: 9 Most Overplayed Songs In Movies

Just after he says this, the blaring sounds of Moby's "Extreme Ways" begins to play. It's an extremely satisfying way to end an action movie, further establishing Bourne's unstoppable, ever-watching nature and finally putting Pam in her place.

"Where Is My Mind?" - Pixies (Fight Club)

The final shot of Fight Club

Aside from being one of the most popular movies of the '90s, Fight Club also contains one of the all-time greatest endings. Just as the bombs go off and the buildings start to come down, the grating guitar sounds of Pixies' "Where Is My Mind?" begins to accompany the destruction.

The sharp and abrasive music lends the climactic scene a fantastic atmosphere, and the lyrics pair well with the movie's dark themes. It's one of the most perfect marriages between film and music in movie history.

"Exit Music (For A Film)" - Radiohead (Romeo + Juliet)

Romeo and Juliet meet through the fish tank in Romeo + Juliet.

Radiohead certainly knows how to set a tone, and "Exit Music (For a Film)" is one of their darkest. It can be found at the end of Baz Luhrmann's Romeo + Juliet, a bizarre modern adaptation of Shakespeare's iconic play.

The story serves as one of the greatest tragedies ever written, and the sullen music of Radiohead pairs perfectly with the movie's calamitous ending. Even after 400 years, creative minds were finding new ways to revitalize Shakespeare's work for modern audiences and the music in this iteration made it all the more unique.

"Wake Up" - Rage Against the Machine (The Matrix)

Neo and Trinity clad in leather in The Matrix

The first Matrix film is, for many, the perfect science fiction movie, and it undeniably has one of the greatest endings of the 1990s. Neo promises to reveal the Matrix, and just as he slams the phone into its cradle, audiences are treated to the loud and driving sounds of Rage Against the Machine's "Wake Up."

Aside from the fitting band name and near-perfect lyrics that match the movie's primary theme, the song's inclusion serves as a fantastic bit of editing. The visuals and music are impeccably paired, with the music beginning just as Neo slams the phone, quieting as he dons his sunglasses, and kicking back up again after he flies by the camera. It's amazing stuff, and it's almost like the song was written to the action on screen.

NEXT: 10 Best Movies About Rock Music, Ranked According To IMDb