He has also enjoyed loan spells at Falkirk and Colchester and spent the first half of this season at Darlington, where he scored nine goals in 19 starts.
"Billy is a lively, hardworking striker who is very mobile," said Gray.
"He has got good pace and is decent in the air for his size.
"He is only 21 but he has already made nearly 100 senior appearances and did well at Darlington during his time on loan there earlier this season.
"He has got good awareness and I have watched him in reserve-team football where he has always impressed me. We are grateful to Jim Magilton at Ipswich for allowing us to borrow Billy. We are also continuing our work to add to the squad further."