The three actors will appear in writer/director David Lowery's contemporary Bonnie & Clyde-style thriller, reports Deadline.
The film is set in the 1970s and centres around an outlaw who escapes from prison.
He begins a journey across the US in order to find his wife and the daughter he has never met.
Lowery's short film Pioneers won the Grand Jury Award at 2011 SXSW, after premiering at Sundance earlier in the year.
Affleck will next lend his voice to ParaNorman and will star opposite Christian Bale and Zoe Saldana in Out of the Furnace.
Foster recently starred in Contraband and just finished production on Kill Your Darlings.
Ain't Them Bodies Saints marks a third new announcement for Mara (The Girl with the Dragon Tattoo), who is said to be eyeing Spike Jonze's next, untitled film and the starring role in the period novel adaptation Brooklyn.