Gray, 39, was pronounced dead at 9:42 p.m. ET on Wednesday, said Lisa Kinney, communications director for the Virginia Department of Corrections.
Ahead of Gray's execution, his lawyers appealed to the US Supreme Court for a stay of the execution -- criticizing the use of a controversial drug combination -- calling it an "experimental and unconstitutional method of execution."
The state of Virginia used a lethal injection composed of a three-drug cocktail of midazolam, potassium chloride and the paralytic drug, rocuronium bromide. Gray's attorneys argued that midazolam had already failed to render prisoners unconscious during executions in Alabama, Arizona, Ohio and Oklahoma.
Gov. Terry McAuliffe issued a statement saying he would not intervene.
"Mr. Gray was convicted in a fair and impartial trial, and a jury sentenced him to death in accordance with Virginia law," the governor said.
Block on death penalty drugs
Executions are typically done with three drugs given in stages: The first (sodium thiopental or pentobarbital) puts the prisoner to sleep, the second (pancuronium bromide) brings on paralysis and the final agent (potassium chloride) stops the heart.
States that have capital punishment have been forced to find new drugs to use since European-based manufacturers began to ban exports of the cocktail ingredients to the United States over concerns the drugs were being used for capital punishment.
Denmark-based Lundbeck banned US prisons from using its pentobarbital.
So, death penalty states began looking for alternatives.
In some executions, controversial drugs as midazolam or propofol have used instead, which has raised much concern.
In January 2014, Ohio used the sedative midazolam and the painkiller hydromorphone
in the execution of convicted murderer and rapist Dennis McGuire. McGuire appeared to gasp and convulse for at least 10 minutes before dying from the drug cocktail used in his execution, witnesses described.
When Oklahoma inmate Clayton Lockett
was sentenced to death by lethal injection he was administered the drug cocktail: midazolam; vecuronium bromide to stop respiration; and potassium chloride to stop the heart. Witnesses described the man convulsing and writhing on the gurney, as well as struggling to speak, before officials blocked the witnesses' view.
Lockett appeared to have a heart attack and died.
Gray and his nephew Ray Dandridge went on a killing spree in January 2006, murdering seven people in six days, court documents
In Dandridge's affidavit, he said that before they went to the the Harvey's home, Gray "smoked marijuana laced with something." Gray's attorneys unsuccessfully argued that the jurors who sentenced him to death did not get a clear explanation of the severe abuse that shaped Gray's life and his subsequent use of PCP, a drug which can cause psychosis.
Gray was convicted of killing Kathryn and Bryan Harvey and their two young daughters, Stella and Ruby, during a home invasion on New Year's Day.
The Harveys were found brutally beaten, bound and repeatedly stabbed in the basement of their Richmond home. The home was also set on fire.
Five days later, Gray was also involved, though not convicted, in the murders of three other Richmond residents: Percyell Tucker, his wife, Mary Tucker and Mary's daughter, Ashley Baskerville.
A Virginia jury convicted Gray of five counts of capital murder and sentenced him to death on two of the counts, the murders of Stella and Ruby, according to the court documents.
Dandridge was convicted in the killings of the Baskerville-Tucker family and sentenced to life in prison.
After Gray's arrest for the Harvey family murders, he also confessed to killing his wife. With the help of Dandridge he bludgeoned her to death with a lead pipe in November 2005, according to the court documents. Gray was questioned at the time but was not arrested for her murder.
"I'm sorry they had to be a victim of my despair"
"There's no excuse for what he did, but it's a tragedy from beginning to end for the Harvey family and for Ricky Gray," Virginia's Attorney General told CNN about the case.
In a video posted on the site, family members and doctors who testified in his case, detail the sexual and physical abuse Gray suffered as a child.
Gray turned to drugs as a child -- using marijuana, cocaine and PCP -- as he "desperately tried to numb the haunting traumas," according to the site.
Days before his execution, Gray issued a public apology.
"I'm sorry they had to be a victim of my despair," Gray said in part in an audio recording posted on the clemency site.
"Remorse is not a deep enough word for how I feel. I know my words can't bring anything back, but I continuously feel horrible for the circumstances that I put them through. I robbed them from a lifelong supply of joy."
Gray is the second inmate to be executed in 2017. Death row inmate Christopher Wilkins, 48, was put to death in Texas on January 11.
Capital punishment is legal in 32 states.