Two people have died, and four, including two children, were left seriously injured in a shooting near a popular Spanish coastal resort.