We present the first spectroscopic data for a sample of the recently discovered blue double-periodic variables in the Magellanic Clouds. The optical spectrum of these objects is dominated by Balmer and helium absorption lines and a continuum with a blue or sometimes flat slope. Spectral classification yields B spectral types and luminosity classes mostly of type III. However, the Hβ absorption line is weaker than expected for the spectral classification in most objects. For two objects, OGLE 05060009-6855025 and OGLE 05195898-6917013 we obtained time-resolved spectroscopy, finding radial velocity variations consistent with binarity. Phasing the short-term photometric variability of these two systems with their spectroscopic ephemeris, we find that they can be interpreted as ellipsoidal variations of the brighter component in a close binary system. From the analysis of their short-term light curves and radial velocities, we estimate that the cooler component could be a B-type dwarf. Our findings support the hypothesis that double-periodic variables are close binary systems consisting of two B-type stars. The shorter periodicity in non-eclipsing systems should be the ellipsoidal variation of the more evolved component. Regarding the long-term periodicity, we find their origin in or around the brighter star, as the oscillations virtually disappear at primary eclipse. Their nature remains unknown, at the present time. We also report the discovery of three (two of them eclipsing) new double-periodic variables in the Large Magellanic Cloud. One of them shows a shortening of the long-term period by approximately 20 per cent in a couple of cycles, which coincides with an increase of the maximum oscillation brightness.