A search for neutral Higgs bosons in the minimal supersymmetric extension of the standard model (MSSM) decaying to tau-lepton pairs in pp collisions is performed, using events recorded by the CMS experiment at the LHC. The dataset corresponds to an integrated luminosity of 24.6 fb(-1), with 4.9 fb(-1) at 7TeV and 19.7 fb(-1) at 8TeV. To enhance the sensitivity to neutral MSSM Higgs bosons, the search includes the case where the Higgs boson is produced in association with a b-quark jet. No excess is observed in the tau-lepton-pair invariant mass spectrum. Exclusion limits are presented in the MSSM parameter space for different benchmark scenarios, m(h)(max), m(h)(mod+), m(h)(mod-), light-stop, light-stau, T-phobic, and low-m(H). Upper limits on the cross section times branching fraction for gluon fusion and b-quark associated Higgs boson production are also given.