We derive the optimal compensation contract in a principal–agent setting in which outcome is used to provide incentives for both effort and risky investments. To motivate investment, optimal compensation entails rewards for high as well as low outcomes, and it is increasing at the mean outcome to motivate effort. If rewarding low outcomes is infeasible, compensation consisting of stocks and options is a near-efficient means of overcoming the manager's induced aversion to undertaking risky investments, whereas stock compensation is not. However, stock plus option compensation may induce excessively risky investments, and capping pay can be important in curbing such behavior.