We present the analysis of multiple-muon events collected with one supermodule (1013 h live time) and two supermodules (1195 h live time) of the MACRO detector at Gran Sasso, Italy. Multimuon rates are shown to be sensitive to primary-cosmic-ray energies between 50 TeV and several thousand TeV. Experimental data are compared with the expected rates from two composition models: a light (i.e., proton-rich) and a heavy (i.e., Fe-rich) composition. The predictions are based on a Monte Carlo simulation of the hadronic interactions of cosmic-ray nuclei, followed by a detailed tracking of the muons through the rock and the experimental apparatus. The results show good sensitivity of the MACRO detector to primary composition. The data exhibit a preference towards the light composition model.