CHICAGO – Matt Cain and Dave Righetti are approaching the logical end of their dozen-year professional relationship — an extraordinary stretch of continuity between a right-hander and his major league pitching coach.

It only makes sense: their fondest memories of one another involve throwing things.

Righetti won’t forget the time that he noticed Cain, as a 20-year-old “bull in a china closet,” beginning his long toss routine to get ready for a start. Most pitchers throw parallel to the warning track. Cain was perpendicular. Righetti knew that wasn’t how it was supposed to be done, but hmmpfh, OK. Part of coaching is letting players learn their own lessons. So Righetti didn’t say anything. In retrospect, he wishes he would have. How could he have known that Cain would air a throw into the bleachers and hit a fan in the head?

Cain won’t forget the time that Righetti, fuming over an umpire’s inconsistent strike zone as well as a rookie left-hander who wasn’t handling it too well, flapped his arms in frustration and accidentally flung his pitch counter over the dugout rail and onto the field.

“Almost to the third base line,” said Cain, his voice full of mirth. “And then the best part, he had to go out and get it.”

Now, all these years later, Righetti is in his 17th season as the Giants’ pitching coach and Cain is coming down to those last few clicks. The Giants hold a $21 million option that they have no plan to exercise. Assuming this is Cain’s final month as a Giant, he would end a tenure here in which only Juan Marichal has started more games, only Marichal and Gaylord Perry have thrown more innings and only Marichal and Tim Lincecum have struck out more batters in the franchise’s 60-year history in San Francisco.

It’s a tenure that is as decorated as it is durable. It includes three World Series rings, a lower postseason ERA than Madison Bumgarner’s (really!), and in 2012, starting assignments in all three playoff series clinchers. And, of course, the only perfect game in the Giants’ 135 years of existence.

Righetti, 58, has been there for all of it – every humbling moment and heady triumph, pushing him at times, counseling him at others, scolding when needed, and often yielding space to fail with the understanding that personal growth stands a better chance in the black soil of personal failure.

What a rarity in this transient sport: for every start that Cain has made, Righetti has been in the dugout keeping a close eye and counting his pitches. For every side session, Righetti stood watching alongside, a half-folded towel over one shoulder, sunglasses perched on his nose, and a sanitary sock loaded up with extra, mud-rubbed baseballs at the ready. For every clubhouse champagne celebration, after Righetti slipped away for his quiet cry and Cain blinked the domestic brut sting out of his eyes, there was that moment when they would find one another, and no words were needed.

There is plenty to be said, though, as you’ll see. Both men recently sat down to share their thoughts on one of the most unique working relationships in franchise history:

RIGHETTI: I want to say it was his first big league camp, two things happened that I won’t forget. We played B games back then and he pitched one against Oakland. I remember Felipe (Alou) being there, and me, the whole staff, we drove over early to watch. There was an incident in the game. Someone was hitting him pretty good, might have hit a homer off him. Next time up, he nailed the guy in the head. He didn’t mean to do that, but he definitely had a streak in him.

CAIN: I was thinking I had to have that mentality. A guy took me deep, so I have to make sure the other guys know I’m not afraid to throw inside. And being 18 years old, I’m out of control, and to hit a guy, that’s awful. Right then, I felt awful. That’s not how the game is supposed to be played and I knew it. But Rags knew my intention, going inside, and that I wasn’t trying to hurt anybody. Him seeing that was good. It ended up being a good learning experience. It was really the first time we started to understand what each other was about.

RIGHETTI: He’s such a young guy, but he was in big league camp because he’s so hyped up. I just remember him coming up to me and he said, `Hey, so, can you let me know when I’m going to start so I can call my parents and they can come in to watch?’ (laughing) I said, `OK, I’ll take care of that for you.’ He said it not in any kind of … he wasn’t trying to be cocky or anything like that. It was just, `OK, sure thing, kid. I’ll take care of that.’

CAIN: Yeah, I definitely do (remember that). My mom and dad were coming in, and I was young and oblivious enough to ask him. Looking back on it now, you’re like, wow. Those are the things that come out of your mouth at a young age. But he knew it was so innocent. There was no intent behind it. And he didn’t tell any of the older guys because he knew they wouldn’t let me hear the end of it. But yeah, I remember it. Probably because he still brings it up from time to time.

RIGHETTI: I had to tell him, `Matty, I know you’re anxious.’ He wasn’t the only one. A lot of people were watching him because we’d lost Russ (Ortiz), we’d lost Livo (Livan Hernandez), (Kirk) Rueter was another year older and Schmitty (Jason Schmidt) was the guy. Barry (Bonds) was still here and we were in that weird place where we were trying to compete and we knew it wasn’t quite right. And here comes Matty, and he’s got this live fastball, and it’s, `Whoa, that’s nice to see,’ this wild stallion, so to speak. He’d already hurt his arm in A-ball, fractured his elbow. So he was walking around already with a little crook in his arm. You’re thinking, `Oh my goodness, is this going to happen for him? Can they move him up the ladder fast so they can take the most advantage of his stuff?’ But he moved up every level and you didn’t feel he was rushed. He was grinding, but he handled it.

CAIN: I mean, I was raw. I was the kid who thought you could wing it up there. It’s `Let’s make every pitch as hard as possible. Let’s try to embarrass guys. Let’s not worry about the pitch count.’ I had no idea about the art of pitching. I still maybe don’t have an idea. (laughing)

RIGHETTI: I’ll never forget him getting warmed up that one time. It was the first really good one he had against the Cubs (a two-hit complete game victory in his third major league start in 2005), and when you’re long tossing, the worst thing you can do is throw towards the people. The first time he did it, I was, `OK, leave him alone.’ And he winged it right in the stands and he nailed this guy. Matty, after he got done, he wanted to throw the guy a ball and apologize and the guy didn’t want anything to do with him. That was the last time he ever did that. Then he went out and pitched a hell of a game.

CAIN: Yeah, there’s a good chance that’s true. I’ve been known to let a couple errant ones go. I remember in A-ball missing the catcher by 10 feet while warming up.

RIGHETTI: The fastball? You saw carry. Life. Those thick legs. He looked like one of those Texas guys, Roger Clemens, Greg Swindell, Josh Beckett kind of guy. You can just tell. He had it. Baby faced but confident. Little bit of a bull in the china closet, but in a good way. A guy like (Jonathan) Sanchez had that life but he could only go up with it. He operated on one plane because of how he threw. Matty could go downhill and uphill with it. Brian Wilson could do that. Schmitty. He was an uncomfortable at-bat, especially for a righty, because he had an awkward way of throwing. He’d almost look up as he was about to throw. A lot of guys are those dart throwers and a hitter can almost follow their eyes and see where they’re going. Matty, it was tough to follow his eyes. He seemed to be always on the edge and then he’d paint. He could be wild pitch to pitch, but he never approached 100 walks or anything like that.

CAIN: There was the time (Matt) Holliday hit that monster homer off me in Colorado and he’s yelling at me around the bases – I’d hit him earlier in the game, and I might have told him to go to first – and I was upset as hell. I probably had three months in the big leagues. I remember Rags was upset too, and he’s coming onto the field while Holliday is still out there (running the bases). It was like Rags was going to take out Holliday for me. That’s how protective he is of his guys. I think he was ready for anything, if it came to that.

RIGHETTI: There’s that bull in a china closet.

CAIN: That’s when I figured out I’m not supposed to hang curveballs to Matt Holliday. I mean, it one-hopped into Helton’s burger joint. It was a tank job, a monster homer. I just showed that to (Kyle) Crick the other day. It was, `Hey, you think you’ve given up a deep one? Watch this.’

RIGHETTI: There’s only been three or four guys like Matty, where the organization knows how important this guy is. Do we leave him alone? Do we fix what we know darn well is going to go wrong? In Matty’s case, we started talking about it early. He knew it wasn’t going to always be easy. He had this thing where he’d slap down hard with his leg instead of getting out there nice and smooth. He looked like he was going to be a closer and we didn’t want that. We wanted a starter. There was a time when we couldn’t finish these games, there was talk about putting one of them, Matty or Timmy, in there. I thought, `Oh man, that’s the last thing we need.’ You knew Matty could figure it out.

CAIN: My initial impression was that Rags wasn’t the coach who saw you throw three pitches and said, `OK, we need to do this and this and this.’ I knew he was going to let me learn and grow and find a way to pitch. He wasn’t going to step in and say that I had to throw a certain way. He let me venture on my own and fail on my own as well to understand that this is part of the growing process.

RIGHETTI: His fastball had that natural, baby cut to it, so away to a righty, the darn thing would be off the end of the guy’s bat. So he’d get a lot of those fly-ball outs there. He’s not a guy who ever got a lot of extension. He does everything really short for a big, tall guy. He doesn’t have a huge stride. Really, he did a lot of it out of pure body and arm strength, and he still has great arm strength. As you get older, it doesn’t always translate to the mound because you’ve got the slope and everything. But playing catch with him, I’ll bet any of those guys will tell you it still feels like it’s coming out heavy.

CAIN: You learn that you’ve got to be craftier in different counts. Bengie (Molina) helped me a ton with that. He put me in uncomfortable situations all the time, throwing to different sides of the plate, and he trusted that I would be able to keep up with him. I noticed a huge turning point in my pitchability when I was able to throw to him, and that carried over to Buster (Posey) and the other guys.

RIGHETTI: Matty had a good curveball, of course, but the changeup really helped him and when he started commanding his fastball better to both sides of the plate, he got really tough.

CAIN: I mean, Rags has seen me since I was 18 years old. He’s kind of raised me in the baseball sense. He’s seen me grow up and mature in lots of different ways. His kids (triplets Nicolette, Natalee and Wesley) were teenagers, not much younger than me, when I got there. So he usually knew exactly what I was thinking, or what I’d try to get away with. That’s what ends up making good coaches and that’s part of what has made Rags relatable to so many guys. He’s been through it, and he’s not so far removed from it.

RIGHETTI: In terms of us getting along, if I had to get on him about something, I did it. I think he understood that. He’d say, `Aw you’re always so mean.’

CAIN: In 2008, he and Boch (manager Bruce Bochy) got on me a little, thought I could do a better job with conditioning. I took pride in it before, but I really took pride in it after. I understood the benefits of it, and got to where the seventh or eighth innings didn’t faze me. I knew my legs would be under me and I wouldn’t be gasping for air. If I had to let it all out, I could do it and do it comfortably.

RIGHETTI: This guy had a stress fracture in his ankle for I don’t know how long. He’d always get hit with balls, even in the spring. And of course he refused to pitch (live batting practice) with the screen. I hated it. I said, `Matty, put the dang thing up.’ He said he couldn’t throw the ball like that, and it’s, `Like hell you can. You’re the last guy who should be pitching without it.’

CAIN: One of my favorite moments was when Alex Hinshaw got tossed out of a game from arguing balls and strikes. He was really, really green, he was arguing when he shouldn’t be arguing, and Rags was fired up and threw his clicker, his pitch counter, onto the field. He didn’t intend to do it. But, I mean, it was almost to the third base line. And then the best part, he had to go out and get it. We’re like, `What is he doing? The umpire was confused as heck, too.

RIGHETTI: You’ll remember, those were the years when we were trying to get him past being that hard-luck guy. Not bad luck, but hard luck, because the other guy is pitching his ass off to beat you. You don’t want the reputation of being a hard-luck guy. I remember (Greg) Maddux stole a base on him that cost him a run. Might have been a one-run loss. Little things like that. Anybody with stuff always thinks that he’ll get anybody out, and you should think that way. But every now and then, you’ve got to look on deck and see a guy you can handle better or the pitcher. Those are the things that can make a difference. By ’09, you saw him getting past that. And for three or four years, there, he obviously wasn’t a hard luck guy anymore. He won some of the biggest games in Giants history.

CAIN: I’m kind of lucky, the perfect game (against Houston in 2012), I didn’t know I was doing it at the time. I was so full of the moment I was just going with it. I didn’t let my brain get in the way. I just kind of let everything happen, and luckily it did.

RIGHETTI: The last couple years (following two arm surgeries) were frustrating only because you want the guy to do well because you know how hard he’s working at it. This spring was the first time he came to grips with, `This is my stuff and I have to look for some movement here.’ He took something off his curveball, which wasn’t easy, because everything he always did was power, power, power. I’m really proud to watch what he’s done this year. It hasn’t translated to a lot of numbers or wins (3-11, 5.66 ERA), but I’m telling you, he’s a better pitcher, no doubt.

CAIN: Realistically, it’s his reputation on the line if a guy is struggling. But it’s never, `I’m going to throw you to the wayside and replace you.’ It’s, `Let’s try to figure this thing out.’ He’s had to do that throughout his career. He’s done it with myself, with Timmy, Barry Zito, he did it with Santiago Casilla, all these guys. He’s not going to write you off because you’re not performing for him or making him look bad. He takes it to heart. He looks at us like we’re all extra sons that he’s had. And we’ve won some big games because of it.

RIGHETTI: We’re talking about him like he’s done pitching. He’s not done pitching. Not if he doesn’t want to be. I’m happy for him because he can dream of, `All right, can I do this again?” He’s got something to think about. He can make a different decision other than, `OK, I’m going home now.’

CAIN: I’m not exactly sure. I’m not. You have your moments when you think, `Yeah, I can keep going for longer,’ and other moments like the game in Arizona (on Aug. 27, when he gave up eight runs in a relief inning), when you go, `Man I’m not sure really how that happened.’ There’s a lot of other factors that come into it, too. It’s not just physical and mental. It’s the lifestyle and not being around my family or not being a dad or husband as much as I’d like to be. There’s a lot of factors. I can’t say for certain what’s going to happen. But sure, going into this season, I knew it was the last year of the contract and next year’s option would be crazy on the business side for them to pick up unless something extreme happens.

RIGHETTI: We’d all like to see him finish over .500 and that (at 104-118) might be tough to do. But we never saw him as a .500 pitcher. It just turned out that way. Any time we put him out there, we felt we had a shot to win.

CAIN: I realized this year that there’s a lot more to the game than being the front guy in the rotation or the special person they look to. I don’t think I knew it at the beginning of spring, but I started to try to at least be able to enjoy going to the field knowing, `Hey you know what? This could be my last season in uniform with the Giants, and if it is, let’s not come to the field upset about it. Let’s find a way to contribute back to the guys in the clubhouse.’ Be more of a leader vocally if I could. I have always been a guy who does my job and doesn’t say as much on leadership part of it. I guess I’ve taken everything this season more as an opportunity, as a good thing, not as a negative.

RIGHETTI: You look up at where he ranks, the longevity, and that’s pretty cool. That’s the mindset we all used to have: make our starts, have our years, be there for the team. Be somebody you can count on. To do that for that many years in the same organization, boy, he’s got to feel great about that. And he’s got the perfect game in the back pocket, and the championships.

CAIN: It hasn’t been the year any of us wanted. But you know, I think Rags has probably handed it better now than he would have in my first couple years. I think he’s maybe seen a lot more and understands what guys are going through. He’s been able to pull guys aside and chat with them and try to pick their brains about what they were thinking. If he’s changed at all, it hasn’t been in a bad way. It’s just neat he and I and Gardy (bullpen coach Mark Gardner) have been together all this time.

RIGHETTI: It’s pretty cool just to watch his maturity and what he’s done with the team, his organization, his family, charity things, and the person he turned out to be. I’m sure his parents are very proud. I know we are.