DME principle

Source.
The interrogator sends a pair of pulses, the DME transponder sends back identical pulses after a fixed delay of 50 μs for X channels, 56 μs for Y channels. The interrogator is able to determine the distance from the round-trip time.
Pulses
The pulses go by pairs spaced by 12 μs for X channels, 36 μs for Y channels.
Rectangular signals generate an infinity of harmonics in their spectrum. To limit the bandwidth to the channel width (1 MHz) a sinc-like shaper is used.
Pulses are not modulated if we except the shaper, it's only CW.
Pulse train with jitter for correlation
The principle is the interrogator repeats pulse pairs at some rate and the transponder replies with the same spacing. The interrogator slightly varies its rate (random jitter) in order to be able to correlate the reply train with its own train and determine the round-trip time, hence the range.
Interrogation rates are:
Faster when trying to correlate the transponder train (about 130 pp/s). The window for correlation is defined by the maximum range of the DME.
Slower when correlated (about 25 pp/s). The window for correlation is defined by the current range of the interrogator and the velocity vector.
A 6-second memory is used if the correlation is lost (extrapolating or not the last known value with the aircraft velocity vector)
Squitter pulses
When there is only a few interrogations, the transponder still maintains a rate of reply pairs of about 2700 pp/s by inserting dummy (squitter) pairs, in order to allow interrogators to identify it and adjust the gain of their receiver.
ID
ID pulses are added every 30/40 s, this is done by using a pulse pairs train at 100 μs spacing to key the Morse signs at 1350 Hz (740 μs spacing).
TACAN / VORTAC DME
In a TACAN the DME reply pairs from the transponder are also used for bearing determination. A rotating directional radiation pattern is used, either using a rotating antenna or a circular phased array.
The pattern rotation rate is 15 Hz, and a ripple is added at 135 Hz for a more accurate bearing determination. The signal strength variation creates at the receiver, like in the conventional VOR, an AM envelope. The apparent modulation index is about 0.2, but is actually dependent on antenna used, it's the result of the minimum and maximum gain in the radiation pattern.
North reference bursts (NRB, 15 Hz) and Auxiliary reference bursts (ARB, 135 Hz) are added to indicate when the rotating pattern has the 15 Hz and 135 Hz maximums facing North.
The composite signal sent, for an X channel is:

Source.
The envelope created by the rotating field can be detected by the receiver to extract the 15 Hz and 135 Hz components and determine their phases using NRB and ARB (135 Hz ripple removed for clarity):

Source.
For a separate DME (not part of a TACAN, e.g. VOR-DME) there is no rotating antenna, no NRB/ARB, the signal amplitude is constant.
More
DME specifications can be found in ICAO Annex 10, volume 1, at §3.5, in particular the shape of the pulses (e.g. rise/fall times).
You can get more technical elements in Test of DME/TACAN Transponders, an application note from R&S.
See also: How does TACAN work? (last section).