Sources have told ESPN that Raya joins on loan for an initial fee of £3 million with an obligation to make the move permanent for a £27m transfer.
Raya, 27, is set to provide competition for Arsenal's number one goalkeeper Aaron Ramsdale and his arrival follows the departure of United States international Matt Turner to Nottingham Forest for a fee that could rise to £10m.
Brentford also announced that Raya signed a new two-year contract at the the club before his departure to the Emirates Stadium.
"I'm sure the first question that all Brentford fans will ask is why this transfer has been structured as an initial loan with Arsenal having the option to make it permanent in the future," said Brentford director of football Phil Giles.
"The answer to that is simply that it enables this deal to be done more rapidly between both clubs, with all parties wanting to make this a permanent transfer as soon as practically possible, whenever that might be.
"David's contract extension is a fall-back position in the event that the transfer is not made permanent. I'm not expecting to see David back at Brentford, although if ever that happened then of course the opportunity to work with such a high-class goalkeeper for up to two more years would in many ways be an unexpected bonus for us."
However, Mikel Arteta's squad depth will be tested this season after qualifying for the Champions League for the first time since 2016-17.
Raya becomes Arsenal's fourth signing of the summer transfer window, following the arrivals of Declan Rice, Kai Havertz and Jurriën Timber, and will take the club's summer spending to more than £230m.
After joining from Blackburn Rovers in 2019, Raya played a key role in Brentford's promotion to the Premier League in 2021 and was an ever-present last season as they finished ninth in the top flight.
Information from ESPN's James Olley was included in this report.