Dr. Otto and the Riddle of the Gloom Beam is a 1985 American science fiction comedy film starring Jim Varney. It was written and directed by John Cherry. It is the first film to feature the Ernest P. Worrell character, but it has a slightly darker tone than his later films. It was shot in Fall Creek Falls State Park, Boxwell Scout Reservation, and Nashville, Tennessee.
https://archive.org/details/dr.-otto-and-the-legend-of-the-gloom-beam-with-intro


I don’t know what it is but this sounds like The Hand mixed with Dreamscape to me