  We derive the Markov-modulated generalized Ornstein-Uhlenbeck process by
embedding a Markov-modulated random recurrence equation in continuous time. The
obtained process turns out to be the unique solution of a certain stochastic
differential equation driven by a bivariate Markov-additive process. We present
this stochastic differential equation as well as its solution explicitely in
terms of the driving Markov-additive process. Moreover, we give necessary and
sufficient conditions for strict stationarity of the Markov-modulated
generalized Ornstein-Uhlenbeck process, and prove that its stationary
distribution is given by the distribution of a specific exponential functional
of Markov-additive processes. Finally we propose an application of the
Markov-modulated generalized Ornstein-Uhlenbeck process as Markov-modulated
risk model with stochastic investment. This generalizes Paulsen's risk process
to a Markov-switching environment. We derive a formula in this risk model that
expresses the ruin probability in terms of the distribution of an exponential
functional of a Markov-additive process.
