Sojourn times of trapping rays and the behavior of the modified resolvent of the Laplacian