McDonald also was charged with child endangerment and violating a court order, the Santa Clara County district attorney's office said. If convicted, he could be sentenced to up to three years in prison.
He was arraigned Thursday but did not enter a plea. He is due back in court in August.
A call to McDonald's attorney, Steve Defilippis, wasn't immediately returned.
Prosecutors said police responded to a domestic disturbance at a home around 4 a.m. May 25 and found McDonald had broken into the woman's bedroom and assaulted her while his driver tried to stop him and she tried to get away.
McDonald cornered the woman in a dining room and trapped her there before he chased her into a bathroom and repeatedly bumped her while trying to grab her cellphone, according to investigators. It continued in the bedroom, where the woman said McDonald jabbed at her head with a finger and tried to pull her off the bed. Part of the incident was caught on cellphone video the woman took.
McDonald eventually left the scene but then returned as police were interviewing the woman, whom authorities haven't identified, before his driver sped away, prosecutors said.
McDonald's mother, LaBrina McDonald, told KNTV in San Jose that it was a "simple argument that got blown out of proportion" and that the charges were "political."
McDonald was arrested later that morning.He was arrested again two days later when police and the woman arrived at the home to find McDonald there in violation of a restraining order, prosecutors said.
"It is unconscionable and illegal for any woman to be trapped, whether it be behind a dining room table or in a relationship filled with fear and violence," prosecutor James Demertzis said in a statement Thursday.
Defilippis told the San Jose Mercury News at the time that neither he nor his client had been notified about the restraining order.
Citing a pattern of behavior and off-the-field issues, the 49ers released McDonald on Dec. 17. He signed a one-year contract with the Chicago Bears in March, only to be released after his May 25 arrest.
The 49ers let McDonald go just a month after Santa Clara County prosecutors declined to file charges against him in a separate domestic violence investigation stemming from an arrest Aug. 31 while celebrating his 30th birthday at his home.
Prosecutors cited conflicting versions of what happened, a lack of verifiable eyewitnesses and a lack of cooperation by the alleged victim, McDonald's then-fiance, in explaining their decision.
In June, a judge dismissed a defamation lawsuit McDonald filed against a woman who accused him of rape.
McDonald says security camera footage shows a consensual sexual encounter occurred in his hot tub.
Police say the woman doesn't recall any sexual encounters and reported blacking out after drinking alcohol and falling at McDonald's home. She said she went to police after waking up naked next to McDonald.
The Santa Clara County district attorney is looking at the case.
Information from The Associated Press was used in this report.
Ray McDonald charged with domestic violence
ESPN legal analyst Lester Munson discusses the charges against former Bears and 49ers defensive tackle Ray McDonald.