Rare events between states in complex systems are fundamental in many scientific fields and can be studied by building reaction pathways. A theoretical framework to analyze reaction pathways is provided by transition-path theory (TPT). The central object in TPT is the committor function, which is found by solution of the backward-Kolmogorov equation on a given potential. Once determined, the committor can be used to calculate reactive fluxes and rates, among other important quantities. We demonstrate here that the committor can be calculated using the method of finite elements on non-uniform meshes. We show that this approach makes it feasible to perform TPT calculations on 3D potentials because it requires many fewer degrees of freedom than a regular-mesh finite-difference approach. In various illustrative 2D and 3D problems, we calculate the committor function and reaction rates at different temperatures, and we discuss effects of temperatures and simple entropic barriers on the structure of the committor and the reaction rate constants.