Consider the problem of estimating the small probability that the maximum of a random walk exceeds a large threshold, when the process has a negative drift and the underlying random variables may have heavy tailed distributions. We consider one class of such problems that has applications in estimating the ruin probability associated with insurance claim processes with subexponentially distributed claim sizes, and in estimating the probability of large delays in single server M/G/1 queues with subexponentially distributed service times. Significant work has been done on analogous problems for the light tailed case (when the moment generating function exists in a neighborhood around zero, so that the tail decreases at an exponential rate or faster) involving importance sampling methods that use exponential twisting. However, for the subexponential case, moment generating functions do not exist in the pertinent regions making exponential twisting infeasible. In this paper we introduce importance sampling techniques where the new probability measure is obtained by twisting the hazard rate of the original distribution. For subexponential distributions this amounts to twisting at a subexponential rate. We also introduce the technique of “delaying” the change of measure and show that the combination of the two techniques produces asymptotically optimal estimates of the small probabilities mentioned above for a large class of subexponential distributions.