It depends on whether or not the matter on which they apparently disagree is a matter of discipline or a matter of doctrine and morals. If it is a matter of discipline, popes are free to disagree with each other. If it is a matter of doctrine and morals, it depends on whether one of the popes is speaking definitively in his capacity as pope and the other is speaking merely as a private theologian. In such a case, the presumption of correctness would go to the pope who is speaking authoritatively in his position as pope.
We must also consider the possibility that what appears to an individual reading the documents to be a contradiction between past and present popes may not indeed be a contradiction. Popes can state the same truth in a variety of ways without contradicting each other. There may also be theological development that will give nuances to earlier doctrinal pronouncements.
DISCLAIMER: Catholic Answers has turned over the archive to Catholic-Questions.org and no longer owns, manages, or moderates the forums. For additional apologetics resources please visit www.catholic.com.