For a number of metallic and nonmetallic U systems as well as a few Th compounds, the near-edge x-ray-absorption fine-structure spectra, taken by transmission and total-electron-yield techniques, are reported at the ${L}_{3}$, ${M}_{3}$, ${M}_{4}$,5, ${N}_{4}$,5, and ${O}_{4}$,5, thresholds. At ${L}_{3}$ and ${M}_{3}$, similar spectra with analogous information are observed. While in the metallic U systems, the white lines at ${L}_{3}$ and ${M}_{3}$ show only minor variations in position and relative peak height, a shift of \ensuremath{\simeq}4 eV is observed between ${\mathrm{UCl}}_{3}$ and ${\mathrm{UF}}_{4}$, representing mainly the difference in Coulomb interaction between a 2${p}_{3/2}$ core hole and the 5f configurations. The spectra at the ${M}_{4}$,5 and ${N}_{4}$,5 thresholds are dominated by intense absorption peaks due to 3d-5f and 4d-5f transitions probing directly the unoccupied 5f states. No multiplet structure due to 3d-5f or 4d-5f exchange interaction is resolved, but the linewidths of the ${M}_{4}$,5 peaks in the metallic U systems are found to decrease by \ensuremath{\simeq}20% with increasing U-U distance, reflecting a narrowing of the unoccupied 5f bands. The spectra at the ${O}_{4}$,5 thresholds, on the other hand, show well-resolved structures, which are atomiclike for ${\mathrm{ThF}}_{4}$ and ${\mathrm{UF}}_{4}$ and may be described by spin-orbit and exchange splitting of the 5${d}^{9}$5${f}^{1}$ and 5${d}^{9}$5${f}^{3}$ final states, respectively. In metallic U systems, the ${O}_{4}$,5 structures are broadened and partly lost, presumably due to the more itinerant nature of the 5f states. Additional relatively weak peaks are observed in the ${M}_{4}$,5 and ${O}_{4}$,5 spectra of Th metal, ${\mathrm{ThO}}_{2}$, ${\mathrm{UO}}_{2}$, and ${\mathrm{UF}}_{4}$ at energies from \ensuremath{\simeq}15 to 38 eV above threshold, which are assigned to multiple-scattering resonances.