Spintronics is an emerging field of research focused on introducing the electron spin degree of freedom into electronics. Its aims include devising new means of magnetization manipulation in ferromagnets and creating systems in which the electrical expression of spin-related phenomena is possible. In this dissertation we present theoretical work important for both of these goals. In a process of ultrafast light-induced demagnetization the magnetization of a ferromagnet decreases on a sub- picosecond time-scale following an excitation by a strong laser pulse. We present a theory of this phenomenon which is applicable to ferromagnetic (III,Mn)V semiconductors. Using it we qualitatively explain the experimental results obtained recently in these materials. We also give a theory of ultrafast demagnetization in transition metals, in which we put previously proposed approaches on a sound conceptual basis, and analyze a new mechanism of demagnetization due to emission of spin waves by hot carriers. Recent progress in growth of metal-semiconductor interfaces has enabled efficient spin-polarized transport between metallic ferromagnets and semiconductors such as GaAs. We present a theory of diffusive spin transport in such metal-semiconductor structures. In contrast to popular one-dimensional approach, we take into account realistic two-dimensional lateral geometry of these systems. We also focus on room temperature regime. Our analysis of spin accumulation achievable in systems of sub -micron dimensions leads to a proposal of a new family of spintronic devices with multiple ferromagnetic terminals in contact with a semiconductor channel. We show that in a three-terminal "spin transistor" digital electric expression of spin accumulation is possible. We also calculate the time-dependent spin transport induced by rotation of one of the magnets in this system, and we show that electrical sensing of magnetization dynamics is realistic in metal-semiconductor structures. An analogous five terminal system can work as a reprogrammable logic gate, with the logic inputs and the gate functionality encoded in the directions of the ferromagnetic terminals. A system capable of electrical detection of circular polarization of light is also modeled. All these proposals will hopefully set new directions in applied spintronics research and stimulate new experiments