Anime
Hints

"Man, Ash, you must be really tired out after last night with me, showing up still wearing your pajamas and all!"
OK, I'm sorry, that's not evidence at all, I just had to do that...I'll be serious now:
Basic Concept
Throughout the Kanto eps, Gary spends a lot of time and energy focusing on teasing and bothering Ash. It's a pretty generally known fact that for kids Gary's age, teasing often indicates a crush. The reason a kid teases a person he likes is because he's still immature and not ready to admit that he has a crush. He's trying to deny it to himself, to convince himself that he hates the object of his affection. This really seems to be the case with Gary, because what other reason does he have for his treatment of Ash? You may say that it's because they're rivals, but a rivalry really isn't enough of a reason for Gary's over the top behavior. Besides, who decided they were rivals in the first place? Gary, that's who; he CHOSE Ash. And it's not as if Gary's just some jerk who's mean to everyone, he never does tease anyone besides Ash. And in a way it seems as if Gary's just trying to get Ash's attention.
And it sure does get Ash's attention. Every time Gary teases him, Ash pretty much flies off the handle, sometimes even seeming genuinely sad. This is a big contrast to how Ash reacts when anyone else teases him; with other people he tends to simply get annoyed or just brush it off. Gary's insults are the only ones that truly upset him. It's pretty clear that he cares more about what Gary thinks of him than he does anyone else. Ash also seems very desperate to impress Gary and to live up to him, almost to the point of obsession.
As the series progresses, we begin to see that underneath it all, Ash and Gary really care about each other. Any time one of them is hurt, upset, or in trouble, the rivalry goes totally out the window and the other rushes to his aid. The fact that they toss the rivalry aside so easily shows that it's really not that important to them. It's likely that the rivalry is just a cover up for deeper feelings.
And do you ever notice that Ash and Gary's relationship is the only one on the whole show that is actually GOING anywhere? I mean honestly Pokemon's not usually much for character development, the characters actions and interactions with others stay basically the same all along. Sometimes they'll show bits from certain characters' pasts, but these revalations don't really change anything. Ash and Gary's relationship is really the only one that has truly had major changes and devlopments over time. As time has gone on, the rivalry has steadily dissipated and instances of caring have shown themselves more and more, and now Gary acts almost like a totally different person towards Ash. The fact that this is the only relationship the writers really bother to develop means it may be one of the most important on the show; and it definitely means they're going SOMEWHERE with this, they're not developing the relationship for nothing.
Episodes
Pokemon Emergency
Here, Prof. Oak tells Ash that Gary bet him that Ash wouldn't have caught a certain number of Pokemon by now. Why does he have to make bets about Ash? Just a good example of how Ash is always on Gary's mind.
Clefairy and the Moonstone
At the end of this ep, Ash finds this written on a sign:
Yup, "Gary was here, Ash is a loser". Seriously, Ash must be pretty
important to Gary if Gary feels the need to write little notes for him to find. He could have put the names of one of the other two trainers who came from Pallet, or no other name at all, but he focused on Ash. Gary really is always thinking of him. In the Japanese version of this ep, Ash envisions Gary making fun of him as he reads the sign. Then he immediately goes tearing down the road to find Gary.
Primape Goes Bananas
As soon as Prof. Oak tells Ash that Gary has more Pokemon than him, Ash decicides to go catch a Primape. And how often does Ash actually catch a new Pokemon? Just an example of how much Ash cares about measuring up to Gary.
Beauty and the Beach
As soon as Ash sees Gary come out on stage, he like goes ballistic and runs up to Gary. And then, Gary winks at Ash!
Dig Those Diglett
As soon as Gary shows up, Ash takes immediate notice of him. Unfortunately for Ash, Gary starts right in on making fun of him, and Ash totally falls apart. I just can't see flying off the handle as badly as Ash does unless it's over someone you care a lot about.

Ash is in pain.
Notice how Brock's expression here closely mirrors Ash's. Brock is upset because he just got rejected by Gary's cheerleaders; much like Ash is upset because he got "rejected" by Gary. It's interesting how often in the series Ash's reaction to Gary mirrors Brock's reaction to some girl he likes.
Anyways, Ash doesn't get over Gary's teasing very quickly, he continues to go on and on about it. While he's listening to the Diglett guy, he suddenly has an outburst and starts yelling about Gary, getting upset enough that he actually falls to his knees down on the ground as if he's about to cry.
You'd think that as upset as Gary has made Ash, Ash wouldn't exactly feel like being nice to Gary right now. But, Ash approaches Gary with a hopeful look on his face and gives him a compliment. Ash REALLY seems desperate for Gary to like him. But Gary just responds with an insult, and the rejection crushes Ash and he falls to his knees on the ground again.
Battle of the Badge
This ep starts out pretty normally, with Gary bragging to impress Ash, and then Ash going all crazy and begging to be let into the gym to follow Gary. But later, when Ash-tachi does finally enter the gym, they of course find Gary and his cheerleaders lying hurt on the ground. Ash yells, "Gary!" and runs to him as Brock yells "The girls!" and runs to them...another example of Ash's reaction to to Gary mirroring Brock's reaction to girls. Anyways, Ash seems truly worried and concerned for Gary, and in the Japanese version, he says "Shigeru, shikkari!" which means, "Gary, hold on!" He actually puts his arms around Gary and holds him while he tells what happened.

See how worried Ash looks?
This in in total contrast to the way he's reacted when he's seen other characters hurt and tried to help them out. He's saved Team Rockets' lives on occasion, but he's always acted really reluctant to do it, usually saying something like, "I'm gonna regret this..." And when he's seen other characters, such as Misty, lying unconcious, he's simply shaken them to wake them up. It's only Gary that Ash ran to, calling out his name, and then pulling him into an embrace and just sitting there holding him. Why is he more concerned for a rival than for anyone else he knows?

Cute ^_^
Ash helping out Gary like that obviously meant something to Gary, because it causes him to immediately have a total change in attitude. When Ash is battling TR, it's Gary who is worrying for him as he gets shocked, and it's Gary who is giving him encouraging words. Gary seems almost in awe as he says, "Maybe...he CAN do it!" It's also Gary who leaps to tackle Meowth to ensure that Ash gets the badge he deserves. And at the end of the ep, Gary even compliments Ash, saying he's a good trainer. Ash holding him must have really meant a lot to him to cause him to suddenly help out his rival so much when he'd done nothing but tease him previously. Once Ash has helped Gary out like this, we start seeing the feelings that Gary has been hiding.
One interesting thing is that near the end of this ep in the Japanese version, Gary says something along the lines of that for having been in 4th place, Ash is a pretty good trainer, and from the expression on his face you can tell he means it in a nice way. The reason this is interesting is because back in the Japanese version of Dig Those Diglett, the insult that Gary was saying to Ash that upset him so incerdibly was, that Ash was 4th. It's like now Gary is taking back that insult and kind of apologizing...aww ^_^
Showdown at the Poke Corral
The theme of Ash and Gary's hidden caring continues in this ep, when shortly after the events in Battle of the Badge, they meet back up at Professor Oak's. Ash seems a little overexcited to see Gary, because instead of asking Prof. Oak about the Pokemon League like he planned to in the first place, he runs to Gary and gets really close up to him, grabbing him by the shoulders and begging HIM for the info. Also, Gary winks at Ash TWICE.
They bicker a little, but soon they agree that both thier training styles are valid and they end up walking around the ranch, talking and looking at thier Pokemon and just generally being freindly. Also near the end of this ep they just stare into each others' eyes for a really long time. And it must not just be some rivalry-based stare since it actually causes Misty to comment that they could like each other; even she could tell they were having a "moment". The whole scene pan as they're staring really resembles the way Jesse and James stared at each other in that romantic scene at the end of Holy Matrimony.
Anyways, Ash and Gary's staring is interupted when TR shows up and attacks. Ash and Gary, without a second thought, fall into perfect to sync planning to battle them together. However, they end up not having to battle after all, since Ash's Tauros get loose and do the job for them. When Gary leaves at the end of the ep, Ash seems sad to see him go.
All Fired Up
Ash is very confident the day before the league games start. But then he runs into Gary, and Gary says he might catch Loser-itus from Ash and tells him he won't win in the league games. Ash is SO upset that he lies awake all night thinking about it!
This just proves how much weight Ash puts on Gary's opinion of him to let it ruin his confidence like that!
Round One- Begin!
When Gary sees Ash, he calls him over and says, "So, your first battle is on the water field?" I guess Gary must have been asking around about him! He then goes on to call him "Ashy-boy", which is SO a pet name.
Later, Gary is on TV for winning his match. He says that in every battle there are winners and there are losers. Then he says, "And some of the trainers I know are REAL losers!" Obviously he's talking about Ash. It just proves that Gary is thinking about Ash ALL the time. Really, how often does a person get to be on TV? Gary uses one of the possibly few TV appearances he'll ever have in his life to talk about ASH. He could have said hello to his family, or friends, but no- he only mentions Ash! He also must have wanted Ash to see him saying that- really, it was sort of a private message for him, because other people wouldn't know that Ash was the one he was talking about. And of course Ash does see it, and gets upset as usual.
Fourth Round Rumble
Ash decides to go and watch Gary's battle. When Gary loses, Ash actually follows him out of the stadium to try to comfort him, even though Gary hadn't exactly been nice to Ash during the League games. And Ash didn't bother to console any of the other trainers who lost, not even the ones he personally battled! It's only Gary that he goes out of his way to comfort; this shows how much Ash cares for Gary's feelings.
Gary simply accepts Ash's sympathy and doesn't make fun of him. Ever since Battle of the Badge, we've seen more and more examples of Gary being nice to Ash, and his teasing has slowly lessened. Hey, you don't expect him to totally change in a day, right? But this showing of sympathy by Ash seems to really be the last straw, and after this we never do see Gary having his mean and teasing attitude towards Ash again.
A Tents Situation
Every time Professor Ivy's name is mentioned, Brock falls to the ground and goes into a state of depression. Misty says it's because Brock LIKED Ivy. Ash doesn't seem to get her point, but when she says Gary's name, Ash himself falls down and goes into a depression. Misty then tells him to quit acting like Brock. It seems the writers are trying to imply something here, having Ash react the same way to Gary's name as Brock reacted to Ivy's name, RIGHT after Misty just said it meant Brock LIKED Ivy. Another example of Ash's reaction to Gary being the same as Brock's reaction to girls.
When Gary finally shows up in this ep, he's being very polite to Ash. Ash spends a while listing his accomplishements to Gary in a seeminly
desperate effort to impress him. Also Ash and Gary spend about the last 5 minutes of this ep staring into each others' eyes.
A Rivalry Revival
After thier match, Gary compliments Ash on a good battle and then leaves. Later, Misty says to Ash, "So, you wanna know where Gary is?" This causes Ash gets all defensive and yell, "Why should I care?!" But of course he DOES care, so he has to immediately run to ask Prof. Oak where Gary is going. When he finds out Gary is doing the Johto League, Ash decides he has to do it too! That's a pretty big deal, that Ash is actually planning the course of his life based on where Gary is going. Ash even confirms in the next episode, Don't Touch that Dile, that he is indeed following Gary.
The Illusion Confusion
When Gary sees Ash running around frightened of the illusions, he comes up and uses his HootHoot to dispell them, saving him. He also gives Ash the solution to get out of the forest; if Gary is so concerned with "staying ahead" of his rival, why does he bother to stop and help Ash out like this?
Power Play
In the first part of this ep, we see a good example of Ash's obsession with Gary. When Gary acts all aloof towards him and refuses to battle him, Ash is really upset. By nightfall, he's STILL ranting on and on about Gary, totally pigging out and saying he's doing it to keep his strength up for the next time he sees Gary. Brock says it may be weeks or months until he sees him again, and Ash yells, "Well, then I'll have to stuff my face every day till then!" The rivalry may have mellowed, but Ash's obsession hasn't.
Later, Gary sees Ash running by him and wonders where he's going. He must have gotten worried about him and followed, because he soon shows up at the power plant and saves Ash from the mecha Wobuffet. And even though earlier Gary was acting like Ash wasn't worth his time to battle, now all of a sudden he's all up on teaming up and working together with Ash to teach TR a lesson, and Ash readily agrees. When Gary goes to open the flood gates, Ash quickly volunteers to go with him and runs after him.
Later when Ash is trying to turn the handle, Brock, Misty and the Pokemon get behind him and try to help. Then Gary comes up facing him and puts his hands over his to help push. Ash acts kind of overly suprised and grateful for this little bit of help from Gary, and he thanks him.
At the end of this ep, Ash says he couldn't have done it without Gary- that's pretty normal, Ash usually thanks the characters or Pokemon who help him out with the little dilema of the day. But then, as Gary is walking away, romantic sounding music cuts in as Ash calls after him in a kind of shy, hesitant voice, "Gary..." as if he can't stand for him to just walk away. When Gary stops, Ash goes on in that same shy voice, basically giving him unnessesary flattery. And now Gary sounds all shy as he says, "Yeah..." At first Gary continues to walk away, but Ash's niceness must have touched him because he has second thoughts and turns around and tells Ash that he did a good job that day and that next time they saw each other, he'd want to battle him. Ash is so happy he can barely belive it, saying, "You mean you'll..." and then breaking into a big smile. As Gary starts to walk away again, Ash has to call after him just one more time, promising that they'll see each other again, and Gary waves. All the shyness and awkward pauses and flattery and unwillingness to part from each other, not to mention the soft music in the background, make this ending scene just scream romantic tension.
Extreme Pokemon!
This one is kind of a milestone because it's the first time when Ash and Gary act completely freindly to each other througout the entire episode. They're competing in a race together, and there's a lot of affectionate banter between them that just seems to show a spark. Gary is also suddenly acting as if he really admires Ash, giving him several unprovoked compliments. And finally, there's a part near the end where they finish each other's sentence; that pretty much speaks for itself.
A Claim to Flame
Ash shows up at the Silver Conference and finds out that Gary is also competing. Later that night, Ash can't sleep, so he goes for a walk. He runs into Gary and the two of them end up sitting by a lake under the stars looking at the moon and talking. Gary gets kind of philosophical and Ash becomes concerned and asks if he's alright. The two also say that they are friends, and Gary calls him "Ashy" ^_^ The setting just has obvious romantic overtones, and the conversation is quite emotionally intimate. It's a very sweet moment.
Later in the episode, when all the competitors are waiting to get into the Conference, Team Rocket manages to lure Ash out of line. They tie him up and steal Pikachu. Gary is the one who notices that Ash has gotten out of line. He gets out of line himself and finds Ash, unties him, and helps him get Pikachu back. In the scuffle, the guy carrying the torch into the Conference is hurt, and it is Gary who suggests that Ash be the one to carry the torch into the stadium.
The Ties that Bind
In this episode, we finally get proof that Ash and Gary did in fact know each other before the first day of thier journeys. There is a flashback scene where Ash and Gary are fishing in the same spot. After arguing for a while, they both hook the same thing- a Pokeball. They fight over it for a while, and it ends up splitting in half.
Did they know each other even before this event? From the way they're talking in the flashback, it seems that they did. It may also be worth noting that in the previous episode, Tie One On!, Ash comments that he and Gary "grew up together."
But the really cute thing is the fact that Ash and Gary each kept his respective half of the Pokeball and each has carried it with him all these years. The two of them carrying around halves of something that fits together seems really suggestive, like soul mates, or like two people having matching class rings.
Can't Beat the Heat!
In this episode, Ash finally beats Gary. While watching the match, Professor Oak comments that even though Gary would never admit it, Ash is his most important friend. Delia says she thinks Ash feels the same way.
After the battle, Gary asks Ash to meet him and gives him his half of the Pokeball, saying he deserves it, and the two clasp hands. In the next episode, Playing With Fire, Gary is there to watch Ash's next battle, and Ash says he wants to finish the battle in a way that will make Gary proud of him. In the next episode after that, Johto Photo Finish, Gary comes to find Ash to inform him that he's decided to quit training and become a Pokemon researcher, and the two clasp hands again before parting ways.
Gotta Catch Ya Later
Misty and Brock having gone their seperate ways from Ash, Ash heads back to Pallet to his mother's house. When his mother mentions that Gary is in town, Ash jumps up in the middle of breakfast and runs off to find him. At Professor Oak's, he learns that Gary has just left, so Ash races to catch him before he's gone.
Gary thanks Ash for coming to say goodbye to him, and Ash gives Gary back half of the Pokeball. Gary accepts it and says he'll take good care of it.
Considering the fact that they're now freinds, this can be construed as nothing other than an attempt by Ash to find some way to continue a relationship with Gary. This shows that, no, it wasn't all just about the rivalry and beating Gary; Ash has done that, yet he still just wants something to ensure future contact between them. It also seems significant that out of everyone, Gary was the last one Ash said goodbye to, as if it was the big important climax.
Gary leaves, and Ash goes to sit in a tree and becomes sad that everyone is gone. He then decides that he wants to be like Gary and have a whole new start on a new journey, and so decides to go to the Houen region.
Advanced Generation Episodes
During AG, there is a long stretch where Ash and Gary's paths do not cross. However, they haven't forgotten about each other. In Lights, Camerupt, Action!, Ash has a flashback of he and Gary watching a movie together when they were children, again showing that they were friends before they were rivals.
In the Special that Gary appears in, Putting the Air Back in Aerodactyl, when Gary gets discouraged, Oak reminds him that Ash wouldn't give up, and this gives Gary the energy to go on. Gary then asks Oak how Ash is doing and also reflects on how he misses Ash.
In May vs Drew! Rivals Forever!, Ash recieves a postcard from Gary. Ash had been feeling badly because he'd just lost a battle, but after imagining himself standing with Gary and responding to the things Gary said in the postcard, he gets a new burst of energy and is ready to keep trying. Oak comments that in times like these, Gary is the best medicine for Ash.
End of a Journey, Yet Beginning of a Journey
In the last AG episode, Ash and Gary finally meet up again. When Ash sees Gary after being apart for so long, he stutters out his name. The two agree to meet back up in Pallet town and battle. After winning the battle, Gary announces that he's leaving for the Shinou region. Much like when he decided to go to Johto to follow Gary, after hearing Gary's plans, Ash decides to go to Shinou too. This seems to indicate that Gary will again be showing up in the anime every once in a while.
Final Word
Ash and Gary just have a certain spark between them. Every time they're together, it's like all the other characters fade off into the background and they only focus on each other. And thier personalities are just the perfect compliment to each other: Gary's calm and cool nature balances out Ash's more impetous and over-emotional nature. They obviously care for each other and are important to each other. And they're just...PERFECT together!