The movie is a remake of a French movie of the same name, released in May last year, and will be directed by Christian Carion, who also directed the original.
Carion wrote the screenplay for the movie with his wife, Laure Irrmann, and then shot the movie in sequence over six days, not telling his lead actor Guillaume Canet what would be happening next and giving him no script to work from.
Read more: Why 007 endures on screen
Carion will be doing the same when he makes the movie with McAvoy, with the Scottish actor only being made aware of the rough elements of the plot.
Watch: James McAvoy on getting into shape for Glass
The X-Men star will then improvise as he goes along, with the rest of the crew aware of what is going to happen.
The plot begins with a phone call to a man from his ex-wife, who tells him that their 7-year-old son has gone missing.
While the mother, to be played by Foy, believes he could have run away, the authorities suspect that he may have been kidnapped.
“We’re thrilled to be working with Christian to create My Son for worldwide audiences,” said Adam Fogelson, the chairman of STXfilms.
“James will be doing the detective work of the film in real time, on camera, to create real tension for this thriller. We like to support bold and innovative storytelling like My Son, and Claire could not be a more spectacular or exciting choice for this film which is certain to thrill audiences.”
Filming will take place in Scotland in November, according to Deadline.
Watch: James McAvoy to narrate reality show for U.K. broadcaster