Your question: What is the logic behind the delay of the signal and how is the echo signal later bound with the signal sent?
Short answer
A PESA is an array of individual antennas. Each antenna radiates the same signal, except the phase. The phase adjustment for each antenna allows for the non-moving array to behave like if it could be rotated, i.e. the direction the energy is sent to or receive from can be selected by adjusting the phase for the individual antennas.
Varying the signal phase for an individual antenna of the array can be done by delaying the signal for this antenna, which in turn is as easy as
making the electrical conductor (or waves guide) between the oscillator and the antenna longer.
PESA determines the transit time exactly like another more traditional one with a single rotating antenna. A signal sent by a PESA, after it has been sent, is indistinguishable from a signal sent by a rotating antenna radar.
Details
The principle of a primary radar is to send a radio signal in a given direction and wait for a possible echo. The direction of the radiation pattern is used in determining the direction (azimuth and elevation) of the reflecting object. The antenna must be very directional (small solid angle of the radiation pattern), else the angle determination cannot be precise.

Radiation pattern of an antenna with a parabolic reflector (source)
That means the antenna must be rotated to scan a useful portion of the sky (or ground).
To clarify the wording used, an antenna is usually composed of:
- A radiator which receives the signal to be transmitted (it also collects the waves in reception). The radiator is the interface between electrons and waves and vice-versa.
- A reflector used to reflect the waves from the radiator (it also focuses the waves on the radiator in reception).
- Sometimes directors to narrow the radiation pattern of the system.
The radiation pattern of an antenna is mostly determined by the shape of the reflector (e.g. the parabolic reflector) which only illuminates a given fraction of the space and, due to interferences, also varies the energy based on the direction the energy is sent to or received from. Due to the reflector, a signal from the radiator will usually travels using different paths created by the multiple reflections.
Interferences are the result of combining the electromagnetic signals at a given point. For signals having the same frequency, the phase determines if signals are added (same phase) or canceled (opposite phases).

Phase determines how signals interfere (source)
We can apply this phenomenon to the multiple signals created in an antenna composed of a radiator and a cylindrical reflector.

Signals summation on a cylindrical reflector antenna creates a privileged direction of radiation with some secondary (unwanted) lobes (source)
Array of radiators (electronically scanned array, ESA)
Another way of varying the privileged direction of a radiation pattern is to create interferences on a voluntary basis, so that they create a stronger signal in the desired direction, and a weaker signal elsewhere. The advantage is that this electronic direction change can be much quicker than a mechanical rotation.
One way to create interferences is to send the radar signal from an array of small radiators instead of a single big one.

Close-up of the front of the old Cobra Judy radar (source)
This type of array is quite familiar under the name interferometer in the field of astrophysics:

Siberian Solar Radio Telescope (SSRT) interferometer observing the Sun at 5.7 GHz (source)
If all radiators are fed with the same signal, then interferences will occur the same way on the whole surface and the result will be that the direction perpendicular to the array is privileged (image on the left side).

Electronic beam-deflection (left: bore sight, right: deflected (source)
The right side of the image shows what happens if the signal sent to the individual radiators is delayed in a coordinated way: Delay increases from right to left on the array. It must be remembered that delay means phase here. The direction of the signal is now oblique due to the the location of constructive and destructive interferences. The red circles indicates signal with the same phase.
See this animation too.
Delaying an electric signal is quite easy: Just increase the length of the conductor (see analog delay line). A length variation between 0 and the wave length (e.g. 10 cm for a wavelength of 10 cm -- 3 GHz) allows to sweep the whole range of possible phase values from 0 to 360°.
Indeed there are other ways to delay a signal without adjusting the length, but they are electrically equivalent. When signals are digitized, it's really easy to process them, there is less electro-mechanical constraints.
By varying the phase on individual radiators we can steer the signal as if the antenna had been rotated, but we can also focus the energy on a target.

(source)
PESA vs AESA
There are two approaches for feeding individual radiators with phase-shifted signals: active and passive:
Active means the radiator has its own oscillator to create its own signal. The active element must receive the value of the phase shift to use from a central element which coordinates the whole array.
Passive means the radiator receives the signal to be sent and just radiates it. The signal must already have the required phase. This is usually done with a single oscillator which feeds an array of phase shifters which in turn feed the array of radiators.

(source)
Transmission vs reception
The beam formed by the array concentrate the energy during transmission. The signal sent is not different than one sent with a single large radiator (rotating radar antenna). This is also a general result of adding and canceling energy by interference.
An array conforms to the general rule: An antenna is reversible, the characteristics of the radiation pattern are also valid in reception. That means:
- Receive the same signal on all radiators
- Add individual delays (phase shifts) to obtain a privileged direction of energy origin. The phase values are inverted compared to the ones used for sending in this direction.
- Mix all signals into a single one to have them interfer and obtain a single mixed signal, equivalent to the one that would have been received with a rotating antenna.
The effect is that energy originating from directions other than the privileged one will be weakened, and the energy in the privileged direction will be emphasized.
Note that the phase is used to change the radiation pattern (process known as beam forming), but the rest of the radar is unchanged compared to a rotating single antenna one.
(Tell me if there is something that is not clear, I'll improve the post as necessary.)
Additional details
Phase shifter
As mentioned a phase shifter is used on each individual antenna of the array. It should prevent signal loss, distortion and noise addition, and the phase must be controlled accurately and quickly, by steps or continuously.
For step by step (digital), delay lines are used, with a possibility to connect a variable number of them using switching diodes (e.g. pin diodes). See more on RadarTutorial.eu with an example of 4-bit shifter (16 phase-shift values). More details on this datasheet for a 6-bit shifter on S-band.
Continuous (analog) control can rely on a resonant circuit (LC) to delay the signal. The capacity value can be mechanically changed in MEMS.

(source)
This extends past what I know in the domain, but other technologies exist, and are detailed in Array Phase Shifters: Theory and Technology (Nasa, 2007), including:
Another style of phase shifter uses coupled microstriplines as dc
electrodes to polarize a thin [...] ferro-electric film [...]. These
planar phase shifters are fairly compact, low loss, easy to fabricate,
and can provide 360° of phase shift with bias voltages under 350 V.
Phase shifters design depends on the operating wavelength of the radar.
Radiators used in a phased array antenna
Again the operating frequency impacts the radiators design.
Low frequencies may use:
Higher frequencies use other designs:
- Notch antenna (slot). Used on Russian N011M (also note the dipole array for lower frequency scan of this hybrid radar).
- Patch antenna (microstrip).
- Vivaldi antenna (tapered slot) for broadband spectrum.
More on RadarTutorial.eu.