I hate hands like this too. You've taken two pretty good swings at the pot and your opponent has stuck around. My guess is you're up against trips, maybe even a full house. Fold.
you shoulda bet the turn. pairing the nine isn't such a bad card for you. given the action, though, now he thinks that his A5 or TT is good. when you checked behind on teh turn, you induced the bluff.