Paul. Whilst Gary was a great foil for Ash in the earlier seasons, he just wasn't around enough to directly impact on him in any meaningful way; he was a cameo rival at best, a character of the day at worse. In the Sinnoh seasons Ash couldn't even sneeze without having Paul appear from out of the shadows to criticise him for it. The two were such polar opposites that they felt like genuine rivals, rather than two ten year-olds stuck in some godawful cheesy love-hate bromance. There was no "the more you hate someone the more you like them" thing going on with Ash and Paul - Ash hated Paul's way of training, and Paul was either indifferent to it or thought Ash was ridiculously naive...which, of course, only annoyed him even more.
Paul was the only one who really ever got a reaction out of Ash. I mean sure, Ash got annoyed with Gary and the others, but they never outright pissed him off the way Paul did. There was never really any attempt at being friendly after that initial introduction: the two were constantly at odds, which only made it that much better when they battled and when they were forced to work together, too.
They also learned quite a bit from one another - Paul using the counter-shield strategy against Ash was pure gold. Ash taking in Chimchar and raising it his own way, but taking the intiative from Paul to pit his Pokemon against one another to improve them. Paul's Torterra giving Ash's advice at varying evolutionary stages (for all the good it did) and so on. It felt natural for Ash to beat Paul at the end of the Sinnoh League; it was a really close battle and the culmination of a ridiculous amount of character development between the two.
Trip isn't even worth mentioning as a rival, and I always felt that Barry was more of a comic relief character than a real rival; he idolised Paul far too much to be a credible rival for Ash, and he was never really much of an influence. Gary was always one step ahead of Ash in the earlier seasons, but because of that we never really got to see enough of him, and in the end he wasn't so much a rival as he was a childhood friend - he took a different path in life and, even after Ash beat him, he could still wipe the floor with him later on...as was the case when his Electivire curbstomped Pikachu.