We study the resummation of large logarithmic perturbative corrections to the partonic cross sections relevant for the process pp->h X at high transverse momentum of the hadron h. These corrections arise near the threshold for the partonic reaction and are associated with soft-gluon emission. We perform the resummation to next-to-leading logarithmic accuracy. We present numerical results for the fixed-target regime and find enhancements over the next-to-leading order cross section, which significantly improve the agreement between theoretical predictions and data. We also apply the resummation for RHIC kinematics and find that subleading terms appear to play a rather important role here.