Rays and wavefronts are used as visual aids to illustrate the passage of light.
In geometrical optics light is assumed to travel in straight line if the medium does not change and in physical optics the light is assumed to be wave-like an hence does not necessary travel in straight lines.
What is the relation between these two meanings?
Essential they are the same.
In theory a (mathematical) ray has zero thickness but in practice this cannot be achieved.
In the diagram if the wavefronts are restricted, eg using a hole in a piece of paper, as shown above delimited by the three rays on the right of the diagram you have a "ray" using a point source.
The approximation to a theoretical ray gets better as the angular separation of the rays in the diagram decreases.
The red line is a ray in the second sense, is it also in the first sense?
Yes as that is the direction of the flow of energy.
The photograph you have shown to illustrate a series of almost parallel rays which are produced by a laser with the wavefronts at right angles to the beam and are an example of so called plane wave(front)s.
If so, how does the wavefront, to which it is perpendicular, look?
As shown above with just the wavefronts defined the rays directed to the right but with the angular separation between the rays being very small.
Thus the wavefronts are essentially parallel to one another.
Please note that wavefronts are the loci of positions where the waves are in phase with one another.
Often they are labelled crests (or troughs) and shown to be one wavelength apart.
In the first picture you might have the full wavefronts as crests and the dashed wavefronts as troughs half a wavelength apart.