This could be a solution, but I think you don't want to use this:

The way I did it in NecroSPACE 1&2 and .S.C.A.G. is just to put hit points on my beam. this way I just checked if there was an intersection between a point and a rectangle. this way there an be more hits and one target, do more damage as it penetrates deeper.