He cried against the altar
"He" refers to the man of God.
cried against the altar
"prophesied loudly toward the altar"
a son named Josiah will be born to the family of David
"a descendant of David will have a son named Josiah"
they will burn
"they" refers to Josiah and the people with him.