LOS ANGELES — Not so long ago, Toni Bias dreamed of playing in the W.N.B.A. But after starring on the girls’ junior varsity basketball team as a high school freshman, Toni came out as transgender last summer, began going by the name Tony and started transitioning to male.

At the time, California had no policy governing transgender high school athletes. Already finding himself the target of bullies, who often taunt him with “he-she,” Tony feared he would have to endure even more abuse if he pushed to try out for the boys’ team.

So he made a wrenching decision: he quit basketball.

“They don’t understand I’m not trying to pretend to be someone else,” Tony, now a 16-year-old sophomore at River City High School in West Sacramento, said. “I’m just trying to be who I was all along.”

Professional sports have grappled with this question for decades, since Renée Richards, who was born male, underwent sex-change surgery and sued the United States Tennis Association to be allowed to play in the women’s draw at the 1977 U.S. Open: How, if at all, should transgender athletes be allowed to compete?