Aswath Damodaran has an interesting post on whether firms have an optimal capital structure or are more opportunistic and sell whatever security seems cheap at the time.
The idea of an optimal capital structure is often formally called the trade off theory. The theory states that firms have an optimal capital structure that is based on the trade off of the costs and benefits of debt. Debt is cheap (tax deductible) but too much increases the risk (and expected costs) of bankruptcy. Therefore firms pick an optimal combination of both. Recent work however, shows that there is evidence that firms often time security markets when they issue equity (I've published a couple of papers on this topic). This theory has come to be known as the market timing theory of capital structure.
Damodaran suggests that perhaps firms have an optimal target and use market timing to take advantage of mispricing opportunities around this target. This is actually the topic of a working paper of mine (with Bill Elliott of UTEP, Ozde Oztekin of KU and Anjo Koëter Kant of VU University). In this paper we argue that firms adjust faster or slower to their targets depending on whether market timing makes it advantageous to do so. In effect we overlay market timing on top of the trade off model of capital structure. The paper is currently being revised as it is working its way through the review process at a journal so I don't have a current version to post, but when we get through the review process I'll post a more detailed discussion.