The NA50 and NA38 experiments have studied muon pair production in p-A and nucleus-nucleus collisions at the CERN SPS. Results on dimuons in the invariant mass region between the ϕ and the J/ψ masses (IMR) are presented. The standard sources of muon pairs in the IMR are the Drell-Yan process and the semileptonic decay of charmed mesons. A new four-dimensional unfolding method is applied to the data. The p-A results are well described in terms of these known sources, which, in contrast, fail to explain nucleus-nucleus data: an extra yield of muon pairs is observed. Although this excess is compatible with an enhanced production of charmed hadrons, other possible sources cannot be excluded. In particular, a comparison between data and predictions from a theoretical model which calculates the production of thermal dimuons is presented in this paper.