In energetic nonthermal sources such as gamma-ray bursts, active galac
tic nuclei, or galactic jets, etc., one expects both relativistic and
transrelativistic shocks acompanied by violent motions of moderately r
elativistic plasma. We present general considerations indicating that
these sites are electron and positron accelerators leading to a modifi
ed power-law spectrum. The electron (or e(+/-)) energy index is very h
ard, proportional to gamma(-1) or flatter, up to a comoving frame brea
k energy y, and becomes steeper above that. In the example of gamma-r
ay bursts, the Lorentz factor reaches y similar to 10(3) for e(+/-) a
ccelerated by the internal shock ensemble on subhydrodynamical timesca
les. For pairs accelerated on hydrodynamical timescales in the externa
l shocks, similar hard spectra are obtained, and the break Lorentz fac
tor can be as high as gamma less than or similar to 10(5). Radiation
from the nonthermal electrons produces photon spectra with shapes and
characteristic energies in qualitative agreement with observed generic
gamma-ray burst and blazar spectra. The scenario described here provi
des a plausible way to solve one of the crucial problems of nonthermal
high-energy sources, namely, the efficient transfer of energy from th
e proton flow to an appropriate nonthermal lepton component.