Born in Irvine, North Ayrshire, in 1624, James was the son of Rev Robert Ramsay a schoolteacher there, by his second wife, Janet Campbell.
He joined the party of the resolutioners, and on 29 May 1661 celebrated the restoration of Charles II by publicly burning the Solemn League and Covenant and the acts of parliament passed during the civil wars.
In 1669 he and Arthur Rose, parson of Glasgow, drew up an address to the king protesting against the recent indulgence granted to presbyterian ministers.
[7] In the second year of his episcopacy he came into conflict with James Sharp, archbishop of St Andrews, whose arbitrary handling of the church had excited widespread discontent.
When, however, in July 1674, Sharp called a meeting of the bishops in his own house to consider certain canons for the church, Ramsay alone ventured to insist on the need of "a national convocation of the clergy".
He was not summoned to the second day's conference, and returned to his diocese, leaving behind a letter denouncing the proposed canons as inopportune, and not within the province of a private consultative meeting of the bishops.
[9] During 1676 and 1677 Ramsay was engaged in a suit against Francis Kinloch of Gilmerton for an annuity due to him as dean of the chapel royal, annexed to his bishopric.
[12] On 3 November 1688, however, Ramsay signed the letter of the Scottish bishops to James, congratulating him on the birth of a son, and expressing amazement at the news of an invasion from Holland.