We discuss the possibility that gamma-ray bursts result from internal
shocks in ultrarelativistic matter. Using a simple model, we calculate
the temporal structure and estimate the efficiency of this process. I
n this model the flow of ultrarelativistic matter is represented by a
succession of shells with random values of the Lorentz factor. We calc
ulate the shocks that take place between those shells, and we estimate
the resulting emission. Internal shocks can produce the highly variab
le temporal structure observed in most of the bursts, provided that th
e source emitting the relativistic flow is highly variable. The observ
ed peaks are in almost one-to-one correlation with the activity of the
emitting source. A large fraction of the kinetic energy is converted
to radiation. The most efficient case is when an inner engine produces
shells with comparable energy but very different Lorentz factors. It
also gives the most desirable temporal structure.