We study superharmonic functions related to elliptic equations with structural conditions involving a variable growth exponent. We establish pointwise estimates for such functions in terms of a Wolff type potential. We apply these estimates to prove a variable exponent version of the Hedberg–Wolff theorem on the dual of Sobolev spaces with zero boundary values.