We devise a theoretical description for the response of nitrogen molecules (N(2)) to ultrashort and intense x rays from the free electron laser Linac Coherent Light Source (LCLS). We set out from a rate-equation description for the x-ray absorption by a nitrogen atom. The equations are formulated using all one-x-ray-photon absorption cross sections and the Auger and radiative decay widths of multiply-ionized nitrogen atoms. Cross sections are obtained with a one-electron theory and decay widths are determined from ab initio computations using the Dirac-Hartree-Slater (DHS) method. We also calculate all binding and transition energies of nitrogen atoms in all charge states with the DHS method as the difference of two self-consistent field (SCF) calculations (ΔSCF method). To describe the interaction with N(2), a detailed investigation of intense x-ray-induced ionization and molecular fragmentation are carried out. As a figure of merit, we calculate ion yields and the average charge state measured in recent experiments at the LCLS. We use a series of phenomenological models of increasing sophistication to unravel the mechanisms of the interaction of x rays with N(2): a single atom, a symmetric-sharing model, and a fragmentation-matrix model are developed. The role of the formation and decay of single and double core holes, the metastable states of N(2)(2+), and molecular fragmentation are explained.