Frankly, McCoy has always been a jerk when it comes to Spock.
Absolutely not true. McCoy banters with Spock a lot but usually it is just banter, sometimes it is not (as someone mentioned Bread & Circuses indicates). But they did respect and care about each other.
Anyways Tholian Web is one of my favorites for the Spock/McCoy relationship.
Yes McCoy was being overly hard on Spock and he was wrong
but he just thought he lost one of his closest friends and he had the health of the entire crew on the line. His reaction was one of strong emotions (this is McCoy we are talking about) and stress.
It's just that in McCoy's stress he seemed to forget that Spock had also lost one of his closet friends and also had the safety of the entire crew on his mind.
Obviously Kirk's words showed McCoy what a fool he was. But the fact that he could see the error in his ways, could apologize, and later on even called Spock "captain" as a gesture of good will shows that it was not out of malice. And of course Spock would forgive him because after all he knows McCoy can't help it, he's just an emotional human.