The problem of optimizing investments in the presence of random risk is of real concern for insurance companies. Like ordinary investors, they have a set of risky and non-risky assets as a choice to invest into. But their wealth depends not only on how they allocate the money, but also on the occurring claims that they have to pay for. These claims arrive randomly, and therefore the risk that they represent is not hedgeable. This work explores the investment strategies which take this risk into account. Chapter 1 introduces the model (a diffusion process) for the available assets. Chapter 2 formulates and presents solutions of various optimization problems for the investor, among which maximizing exponential utility of the final wealth and minimizing probability of ruin. It will be shown that the mentioned problems both result in the constant investment independent of the level of wealth of the company. Chapter 3 covers the extension of the model with a possibility of a crash modelled as a fall of the stock prices which get highly correlated at the moment of the crash. The optimal strategy for minimizing exponential utility of final wealth will turn to be the one which is indifferent between occurrence of the highest crash possible and its non-occurrence at all.