The result puts nine points between Bilbao and Sevilla, who have three games to play, in the race for fourth spot in La Liga, and Ernesto Valverde's side also have a superior goal difference at present.
They were soon rewarded with a lead as another good delivery from Susaeta was headed beyond Ruben in the Vallecano goal in by San Jose on 20 minutes, for his fifth of the season.
However, it was Bilbao who added to the scores as De Marcos stabbed home from close range on 32 minutes after Rayo had again failed to clear a corner, as they did for the first goal.
The hosts rarely threatened a second-half comeback, although Trashorras did test Gorka Iraizoz from range.
Herrera wrapped up the points with a bizarre third as his free kick from the left byline looped over everyone, including Vallecano stopper Ruben, on its way into the bottom corner.
Vallecano remain ninth in the table after suffering just their second defeat in 11 league matches.