The 21-year-old, who joined the Town from Premier League club Crystal Palace last summer, has agreed terms on the move having undergone a medical at Huish Park this afternoon.
Gray scored four goals in 28 appearances – 20 of them starts – during his time at Kenilworth Road and was the only member of Nathan Jones' squad to net in all four competitions last term.
Jones said: "Jake is a terrific young player who has never caused me any problem. I just couldn't see him impacting the team regularly and it's only fair to let him move on to let him play the games he needs."
The former Glovers defender added: "I know from personal experience that he's joining a great club who will help him develop. He'll enjoy life in Somerset and we wish him well in his career."
We would like to thank Jake for all his efforts in a Luton shirt and wish him good luck for the future.