A search for dark matter particles directly produced in proton-proton collisions recorded by the CMS experiment at the LHC is presented. The data correspond to an integrated luminosity of 18.8 fb−1, at a center-of-mass energy of 8 TeV. The event selection requires at least two jets and no isolated leptons. The razor variables are used to quantify the transverse momentum balance in the jet momenta. The study is performed separately for events with and without jets originating from b quarks. The observed yields are consistent with the expected backgrounds and, depending on the nature of the production mechanism, dark matter production at the LHC is excluded at 90% confidence level for a mediator mass scale Λ below 1 TeV. The use of razor variables yields results that complement those previously published.