The soundtrack of the film was composed by the sitar player Ravi Shankar, who was at an early stage of his career, having debuted in 1939.[56] The background scores feature pieces based on several ragas of Indian classical music, played mostly on the sitar. The soundtrack, described in a 1995 issue of The Village Voice as "at once plaintive and exhilarating",[57] is featured in The Guardian's 2007 list of 50 greatest film soundtracks.[58] It has also been cited as an influence on The Beatles, specifically George Harrison.[59]
Shankar saw about half the film in a roughly edited version before composing the background score, but he was already familiar with the story.[45][60] According to Robinson, when Ray met Shankar the latter hummed a tune that was folk-based but had "a certain sophistication".[45] This tune, usually played on a bamboo flute, became the main theme for the film. The majority of the score was composed within the duration of a single night, in a session that lasted for about eleven hours.[45] Shankar also composed two solo sitar pieces—one based on the raga Desh (traditionally associated with rain), and one sombre piece based on the raga Todi.[61] He created a piece based on the raga Patdeep, played on the tar shehnai, by Dakshina Mohan Tagore to accompany the scene in which Harihar learns of Durga's death.[62] The film's cinematographer, Subrata Mitra, performed on the sitar for parts of the soundtrack.[63]