This paper develops an incomplete contract model of the licensing relationship that is susceptible to the moral hazard problem. The optimal contractual form of licensing derived in the model generates predictions that seem to be consistent with actual practice. For instance, the introduction of inputs that are not contractible and costly explains the prevalence of royalty contracts in the licensing relationship. Moreover, the model is able to relate the size of the royalty rate to the parameters that represent the environments under which the concerned parties operate. The framework also provides a rigorous evaluation of the recent debate on the issue of technology licensing and competitiveness in the global economy. In addition, the difficulty that the licensor faces in controlling the use of information in the development of related products in the future can also explain the rationale for including grant-back clauses in licensing contracts. Finally, the model can be naturally extended to analyze the choice of a technology holder between direct investment and licensing in an attempt to serve a foreign market.