Eight months ago, UFC lightweight Stevie Ray decided to take a gamble with his career -- but he didn't fully realize the bet he was making.

Ray (21-7) will face Kajan Johnson at UFC Fight Night this weekend in London, but he essentially has been out of a job since July. That month, Ray fought fellow contender Paul Felder in his native Scotland, in the final bout of his UFC contract.

The UFC offered to re-sign Ray to a long-term contract before that fight, but his management advised against it. He was 5-1 in the UFC, and Felder was a quality opponent.

So Ray took a risk. If he beat Felder, he believed the UFC would sweeten its initial offer. And if he lost, well, the offer might lessen a bit.

It never occurred to him that the UFC would deny an offer -- period.

"I believed, if I beat Felder, I would get the contract I wanted," Ray told ESPN's Five Rounds podcast. "And if I didn't beat Felder, I would get little less. I was willing to take that risk and fight out my contract. I never believed I would not get a contract."

Unfortunately for Ray, that's exactly what happened. He lost to Felder via knockout, and then sat by the phone for a call that never came.

Eventually, Ray left his old management for Ali Abdelaziz, whose Dominance MMA agency represents numerous UFC-rostered fighters.

One of those, Rustam Khabilov, was originally scheduled to face Johnson (22-11-1) this weekend, but withdrew because of injury. Khabilov's misfortune was the opportunity Ray badly needed.

The UFC picked him up as a replacement and re-signed him to a new deal.

"I had been training just in case I got the call for London," Ray said. "Time was running out. The card was filling up, if not filled [completely]. I just started really losing hope.

"I would say I probably made a mistake [fighting out my contract]. I should have known. If I knew there was a risk of not being re-signed, that's too much of a gamble to get a little bit more money. To potentially end my career if I didn't get on another UFC contract -- I would be done."

Ray said the UFC could have "punished" him had it wanted, because it knew he was desperate to re-sign, but UFC matchmaker Sean Shelby offered Ray the same deal he was initially offered before the Felder bout. So his gamble didn't cost him a contract in the end, just time.

Kajan Johnson faces a tough test against Stevie Ray in London this weekend. Perry Nelson-USA TODAY Sports

The potential of athletes fighting out contracts and fielding multiple offers has been a hot topic in recent years -- and Ray says he's not against it, under the right circumstances.

He would advise, however, any fighter considering it to strongly weigh the possibility of losing an offer altogether, as well as what he or she brings to the different promotions bidding on talent.

"I think free agency depends on who you are and how much hype you have, how much of a personality you've got," Ray said. "Yeah, you want to get the wins, but it's not necessarily all about the wins. It's about the entertainment and how popular you are.

"Sometimes, people don't just want to see you win. They want to see someone who is entertaining, win or lose. Someone that maybe talks as well. I think maybe I need to open up a little bit more."