A technique for time-dependent boundary value problems in the kinetic theory of gases Part I. Basic analysis