An inclusive search for supersymmetry in events with at least one b-tagged jet is performed using proton-proton collision data collected by the CMS experiment in 2012 at a center-of-mass energy of 8 TeV. The data set size corresponds to an integrated luminosity of 19.3 fb(-1). The two-dimensional distribution of the razor variables R-2 and M-R is studied in events with and without leptons. The data are found to be consistent with the expected background, which is modeled with an empirical function. Exclusion limits on supersymmetric particle masses at a 95% confidence level are derived in several simplified supersymmetric scenarios for several choices of the branching fractions. By combining the likelihoods of a search in events without leptons and a search that requires a single lepton (electron or muon), an improved bound on the top-squark mass is obtained. Assuming the lightest supersymmetric particle to be stable and weakly interacting, and to have a mass of 100 GeV, the branching-fraction-dependent (-independent) production of gluinos is excluded for gluino masses up to 1310 (1175) GeV. The corresponding limit for top-squark pair production is 730 (645) GeV.