CAPE ELIZABETH — When a coach is on the verge of winning his 300th game with the program, it would figure that his players eventually would listen to him.

And they did. Cape Elizabeth finally showed the patient, effective offense Jim Ray was calling for, and rallied to beat Greely 45-38 in a Western Maine Conference boys’ basketball game Tuesday night.

Both teams are 12-3, but the big number was Ray’s 300th win at Cape. He shrugged that off.

“I guess,” he said about the milestone. “Somebody else keeps track of that stuff.”

What Ray kept track of was how his team began the second half, moving the ball around and hitting open shots.

“We’re trying to demonstrate more patience and make them play defense longer,” Ray said. “The coaching staff is wondering when (the Capers) are going to recognize that patience is a big piece of our offense – recognizing when the opening is there, when the shot is there.”

Down 23-16, Cape Elizabeth began the second half by keeping the ball for 50 seconds before James Bottomley hit a 3-pointer.

Cape, which shot 27 percent in the first half, shot 43 percent in the second.

Bottomley scored all 10 of his points in the second half. Finn Bowe led the Capers with 12 points. Justin Guerette grabbed 13 rebounds. Matt McDevitt of Greely scored 13 with 13 rebounds.

Besides the improved offense, Cape Elizabeth came back with defense, holding Greely to two points in the third quarter and tying the game, 25-25. The Rangers shot 33 percent for the game.

“Our best defense all year,” Ray said of the pressuring, man-to-man effort.

Bottomley began the fourth quarter with two drives to the basket. Marshall Peterson hit a 3-pointer and Cape kept the lead for good.

“We just couldn’t put the ball in the hoop,” Greely Coach Travis Seaver said. “Give Cape a lot of credit. They took away things we were trying to do.”

It was quite a different outcome from the season opener, when Greely broke open a close game by starting the second half with a 20-2 run in a 73-47 rout.

“We underestimated them by so much last time,” Bottomley said. “Now that we know what they are capable of, we came prepared.

“We wanted to be patient with our shots rather than chucking it up, which sometimes happens when we get nervous. By the second half we were able to buckle down and make those shots.”

Cape used a balanced approach with six players scoring in the final period.

Guerette’s jumper made it 34-29; Bowe hit a three-pointer (37-30) and Quinn Hewitt a baseline drive (39-31). Hewitt, Bowe and Marcus Donnelly finished it up with free throws.

The Cape effort was typical of a Ray team, Seaver said. “Coach Ray is obviously a great coach. Tonight’s a great testament. He gets the most out of his kids every night.”

Seaver, meanwhile, has a team that was coming off a loss to Marshwood last week. “It’s a little bit of a rough stretch,” Seaver said. “One great thing about these guys is they compete. I’m not concerned at all about competing.”

Ryan Twitchell added nine points for the Rangers and Caleb Normandeau scored eight.

Cape Elizabeth is next home to Biddeford on Friday. Greely plays host to Westbrook on Saturday.