Lamb shift of a tightly bound electron I. Method