Lactantius condemned those involved in "prayers to dead men" and "prayers to the dead":
"They [pagans] ought therefore to have understood from the mysteries and ceremonies themselves, that they were offering prayers to dead men." (The Divine Institutes, 1:21)
"But if it appears that these religious rites are vain in so many ways as I have shown, it is manifest that those who either make prayers to the dead, or venerate the earth, or make over their souls to unclean spirits, do not act as becomes men, and that they will suffer punishment for their impiety and guilt, who, rebelling against God, the Father of the human race, have undertaken inexpiable rites, and violated every sacred law." (2:18)
One way in which advocates of praying to the deceased could attempt to dismiss these passages in Lactantius is by arguing that the dead are those who are spiritually dead, not physically dead. Thus, one can pray to those who are spiritually alive in Heaven without falling under Lactantius' condemnation. The physical death of those individuals who are in Heaven is irrelevant, since Lactantius is referring to spiritual death.
There's no evidence that Lactantius believed in prayer to people who are spiritually alive in Heaven. And scripture, which probably influenced Lactantius on this issue, condemns attempts to contact the dead in general, not just by means of prayer (Deuteronomy 18:10-12, Isaiah 8:19, 19:3). It would be absurd to suggest that such Biblical passages are condemning attempts to contact the spiritually dead. Was Moses sinning by speaking with the spiritually dead Pharaoh? Physical death is in view when attempts to contact the dead are condemned. If Lactantius was influenced by such Biblical passages, as seems likely, then he probably had physical death in mind. And though the phrases "dead men" and "the dead" can refer to those who are spiritually dead, they're more commonly used to refer to the physically dead. Those who want to propose that Lactantius had a less common definition in mind bear a heavier burden of proof.
The references to death nearest to the first passage above, 1:21, are references to physical death.
And near the beginning of 2:18, we read:
"For He has determined at the last times to pass judgment on the living and the dead, concerning which judgment I shall speak in the last book."
When people speak of God's judgment of "the living and the dead", how are they usually defining "the dead"? Normally, they're referring to God's judgment of those who had physically died prior to that point. Physical death is being referred to. That's what we see elsewhere in Lactantius:
"After these things the lower regions shall be opened, and the dead shall rise again...[quoting another source] 'Rolling along the heavens, I will open the caverns of the earth; and then I will raise the dead, loosing fate and the sting of death; and afterwards I will call them into judgment, judging the life of pious and impious men.' Not all men, however, shall then be judged by God, but those only who have been exercised in the religion of God. For they who have not known God, since sentence cannot be passed upon them for their acquittal, are already judged and condemned, since the Holy Scriptures testify that the wicked shall not arise to judgment....the dead will rise again, not after a thousand years from their death, but that, when again restored to life, they may reign with God a thousand years....Then they who shall be alive in their bodies shall not die, but during those thousand years shall produce an infinite multitude, and their offspring shall be holy, and beloved by God; but they who shall be raised from the dead shall preside over the living as judges." (7:20, 7:22, 7:24)
He's referring to redeemed individuals, people who are spiritually alive, as "dead". Thus, the opening of section 2:18 is including people who are physically deceased, even though they're spiritually alive, among "the dead".
Later in section 2:18, just before the comment on prayers to the dead, Lactantius refers to the dead again:
"I have shown that the religious rites of the gods are vain in a threefold manner: In the first place, because those images which are worshipped are representations of men who are dead; and that is a wrong and inconsistent thing, that the image of a man should be worshipped by the image of God, for that which worships is lower and weaker than that which is worshipped : then that it is an inexpiable crime to desert the living in order that you may serve memorials of the dead, who can neither give life nor light to any one, for they are themselves without it: and that there is no other God but one, to whose judgment and power every soul is subject."
Notice, first, that the pagans Lactantius is condemning for "deserting the living in order that you may serve memorials of the dead" weren't deserting spiritually alive believers. It's not as though pagans were in fellowship with Christians, then left that fellowship to tend to memorials of the spiritually dead. The likely meaning of Lactantius' comment is that he's distinguishing between the physically living and the physically dead.
Also notice that he refers to what he wrote earlier about "representations of men who are dead". Below are some examples of what Lactantius says elsewhere about images of dead men. Ask yourself whether he's referring to spiritual or physical death:
"Cicero, in his treatise concerning the Nature of the Gods, having said that three Jupiters were enumerated by theologians, adds that the third was of Crete, the son of Saturn, and that his tomb is shown in that island. How, therefore, can a god be alive in one place, and dead in another; in one place have a temple, and in another a tomb?" (1:11)
"For the plan of making likenesses was invented by men for this reason, that it might be possible to retain the memory of those who had either been removed by death or separated by absence. In which of these classes, then, shall we reckon the gods? If among the dead, who is so foolish as to worship them? If among the absent, then they are not to be worshipped, if they neither see our actions nor hear our prayers. But if the gods cannot be absent—for, since they are divine, they see and hear all things, in whatever part of the universe they are—it follows that images are superfluous, since the gods are present everywhere, and it is sufficient to invoke with prayer the names of those who hear us. But if they are present, they cannot fail to be at hand at their own images. It is entirely so, as the people imagine, that the spirits of the dead wander about the tombs and relics of their bodies. But after that the deity has begun to be near, there is no longer need of his statue....But they fear lest their religion should be altogether vain and empty if they should see nothing present which they may adore, and therefore they set up images; and since these are representations of the dead, they resemble the dead, for they are entirely destitute of perception." (2:2)
"From nothing, therefore, can it be so plainly proved and understood that those gods, since they once lived, are dead, as from their worship itself, which is altogether of the earth." (6:2)
He refers to tombs, loss of bodily senses, and the fact that those now dead were once living. Clearly, he has physical death in mind.
The next reference to the dead in section 2:18 is the comment on prayers to the dead. Thus, multiple references to "the dead" as those who have physically died come just before his comment on praying to the dead. He's condemning prayers to the physically dead.
Do Roman Catholics and Eastern Orthodox pray to the physically dead? Yes, they do.
In this same section of Lactantius, he tells his readers that we should:
"direct our eyes to that quarter to which the condition of their nature has directed, and that we may adore and worship nothing except the single deity of our only Creator and Father...the spirits which preside over the [pagan] religious rites themselves, being condemned and cast off by God, wallow over the earth, who not only are unable to afford any advantage to their worshippers, since the power of all things is in the hands of one alone, but even destroy them with deadly attractions and errors; since this is their daily business, to involve men in darkness, that the true God may not be sought by them."
He's not trying to direct his readers toward prayer to God and spiritually alive humans and angels. Rather, he seems to want them to pray to "nothing except the single deity of our only Creator and Father...the true God". Not only does Lactantius condemn prayer to the physically dead, but he also suggests that God alone is the proper object of prayer.
A possible objection to the interpretation I've laid out is Lactantius' comment above about "deadly" attractions. The attractions in question are spiritually deadly. Thus, when he goes on to refer to "the dead", he may be referring to the spiritually dead, not the physically dead.
There are a few problems with that argument. First, though references to death in the surrounding context are some of the evidence relevant to how we interpret Lactantius, they aren't the only line of evidence I've cited. The other factors I've mentioned above would have to be taken into account as well. Second, references to physical death are more prominent in the section of Lactantius under consideration, even though the concept of spiritual death is present to some extent. Third, "deadly" is a different term than "the dead". Fourth, the earlier reference to prayers to the dead in 1:21 has references to physical death in its nearest context and probably is referring to the physically dead. Thus, there's precedent for reading 2:18 in that manner. A reference to praying to the physically dead in 2:18 makes more sense conceptually and in light of all of the contextual factors involved.