Gray was born in Los Angeles to actress Beatrice Gray (March 3, 1911 – November 25, 2009), and her husband, William H. Gray. His mother was mostly uncredited in the 1930s and 1940s, having appeared in Otto Preminger's Laura, with Gene Tierney and Dana Andrews. In 1949, Billy Gray appeared with his mother in separate scenes in the film Abbott and Costello Meet the Killer, Boris Karloff.
In 1951, at age 13, he appeared in the film Jim Thorpe -- All-American, with Burt Lancaster in the lead role. Gray portrayed the Indian athlete Jim Thorpe as a child. Later that year, he was chosen to appear in the science fiction picture The Day the Earth Stood Still. Michael Rennie played the part of the alien who befriends a boy played by Gray. In 1952 he appeared in an uncredited role as one of the many children in Ma and Pa Kettle at the Fair. That same year he played George Murphy's son in MGM's Talk About a Stranger, portraying a boy who saves his money to buy a dog, only to have it killed by a strange reclusive new neighbor played by Kurt Kasznar. Gray in 1952 was also slated to play the part of Tagg Oakley in the syndicated western television series Annie Oakley, starring Gail Davis and Brad Johnson. Billy did perform as Tagg in the first of two pilots produced for that series, in the 1952 episode titled "Bull's Eye", which potential sponsors opted not to purchase and underwrite the series. The role of Tagg later went to 12-year-old Jimmy Hawkins for the series' second pilot, "Annie Gets Her Man", and for the full run of Annie Oakley after sponsors bought the series. Gray instead joined the cast of Father Knows Best, which would premiere nine months after the first broadcast of Annie Oakley in January 1954.
After Gray's brief work on the Annie Oakley series, Warner Bros. in 1953 cast Gray as Wesley Winfield in By the Light of the Silvery Moon, a sequel to On Moonlight Bay (1951) in which Gray had played the role of the same Wesley Winfield. He appeared as Alan in the 1953 episode "Shot in the Dark" of the Adventures of Superman, starring George Reeves. In that episode's plot, the character Alan takes a photograph of Superman that could expose the hero's secret identity. Also in 1953 Billy Gray appeared in "The Girl Next Door" as Dan Dailey's son Joe Carter. In 1953 Billy Gray appeared in "All I Desire" as Barbara Stanwyck's son Ted Murdoch.
In 1955, Gray appeared in The Seven Little Foys, which starred Bob Hope as famed vaudeville entertainer Eddie Foy, in the teen role of Bryan Lincoln Foy. In 1957, while still on Father Knows Best, Gray appeared as Mike Edwards in the episode "Come Back Darling Asta" of Peter Lawford's NBC crime series The Thin Man, based on the work of Dashiell Hammett.
After Father Knows Best, Gray appeared in several dozen single-appearance television roles. In 1960, he guest-starred as Frankie Niles in the episode "Dark Return" of the ABC western series Stagecoach West, a program similar to the longer-running Wagon Train. That same year he portrayed David Ross in the episode "Ginger's Big Romance" on Bachelor Father.
In 1961, he played Johnny Blatner in the episode "Two-Way Deal" of the Henry Fonda/Allen Case NBC western The Deputy. He appeared twice in 1961 on the anthology series General Electric Theater, hosted by Ronald W. Reagan. That same year he was Perry Hatch in "The Hatbox" of CBS's Alfred Hitchcock Presents. In 1962, he appeared on CBS's The Red Skelton Show. His other roles included appearances on The Greatest Show on Earth and Combat!. He guest-starred in such series as Rawhide, Arrest and Trial, and Custer.
In 1962, at age 24, Gray was arrested for possession of marijuana. The arrest was blamed for later costing him film and television roles. He appeared as a heroin dealer, "City Life", in the 1971 film Dusty and Sweets McGee. Critic Leonard Maltin claimed incorrectly that Gray had been recruited for the role of "City Life" from actual addicts and narcotics dealers. Maltin did not remove the false information from his guide for another two decades, and only after Gray filed suit for libel.
In 1977, Gray appeared on both Father Knows Best television movie reunion specials that aired on NBC: the Father Knows Best Family Reunion special on May 15, 1977, and the Father Knows Best: Home for Christmas special on December 18, 1977. Both specials were reunions of the entire cast from the former series that had left the air 17 years earlier.
In a 1983 interview, Gray spoke disparagingly of Father Knows Best:
"I wish there was some way I could tell the kids not to believe it. The dialogue, the situations, the characters they were all totally false. The show did everyone a disservice. The girls were always trained to use their feminine wiles, to pretend to be helpless to attract men. The show contributed to a lot of the problems between men and women that we see today.... I think we were all well motivated, but what we did was run a hoax. 'Father Knows Best' purported to be a reasonable facsimile of life. And the bad thing is, the model is so deceitful. It usually revolved around not wanting to tell the truth, either out of embarrassment, or not wanting to hurt someone. If I could say anything to make up for all the years I lent myself to (that), it would be, 'You Know Best."
As the co-owner of a company called BigRock Engineering, Gray markets several products that he has invented, including a self-massager, high-technology guitar picks, and a candleholder for jack-o-lanterns. He raced competitively at dirt tracks in southern California from 1970 to 1995. He has since been a spectator and finds the sport is shrinking in availability.
Gray still resides at the house in Topanga, California, which he purchased in 1957 at the height of his Father Knows Best popularity. The house has over the years become something of a "motorcycle museum".