  We investigate the local times of a continuous-time Markov chain on an
arbitrary discrete state space. For fixed finite range of the Markov chain, we
derive an explicit formula for the joint density of all local times on the
range, at any fixed time. We use standard tools from the theory of stochastic
processes and finite-dimensional complex calculus. We apply this formula in the
following directions: (1) we derive large deviation upper estimates for the
normalized local times beyond the exponential scale, (2) we derive the upper
bound in Varadhan's lemma for any measurable functional of the local times, and
(3) we derive large deviation upper bounds for continuous-time simple random
walk on large subboxes of $\mathbb{Z}^d$ tending to $\mathbb{Z}^d$ as time
diverges. We finally discuss the relation of our density formula to the
Ray--Knight theorem for continuous-time simple random walk on $\mathbb{Z}$,
which is analogous to the well-known Ray--Knight description of Brownian local
times.
