Foy was the son of John Foy, M.D., was born at York, and educated at Trinity College, Dublin, of which he became a senior fellow. He was ordained priest in 1670, and in the same year was installed as a canon of Kildare. On 20 December 1678 he was appointed minister of the parish of St. Bride, Dublin. In the reign of James II he stood up boldly in defence of the established church. Crowds assembled at St. Bride's every alternate Sunday to hear his replies to the sermons delivered at Christ Church on the preceding Sundays by a doctor of the Sorbonne in the presence of the king. This task he accomplished by means of abstracts of his antagonist's arguments supplied to him by gentlemen who wrote shorthand. He was prevented from preaching on several occasions by the menaces of some of the king's guard, and his firmness in supporting the protestant faith fled to his being imprisoned, together with Dr. King and other clergymen.
After the battle of the Boyne his constancy was rewarded by William III, who promoted him to the united sees of Waterford and Lismore by letters patent 13 July 1691. In September 1695 he was imprisoned in Dublin Castle for three days by order of the House of Lords, because he had spoken disrespectfully of that assembly in a protest against the rejection of a bill for union and division of parishes. He died in Dublin on 31 Dec. 1707, and was buried at the west end of Waterford Cathedral, in St. Saviour's Chapel.
During his lifetime he expended 800l. on the improvement of the palace at Waterford, and by his will he established and endowed the free school at Grantstown. His only publication is ‘A Sermon preached in Christ's Church, Dublin, on 23 October 1698, being the anniversary thanksgiving for putting an end to the Irish Rebellion, which broke out on that day 1641. Before the House of Lords,’ Dublin 1698, 4to.