I'm no expert, but just to give you a starting point: perhaps you could put a grid perpendicular to the direction you're aiming, and only keep the rays whose angle from the direction is within coneAngle?
ASCII art:
+--+--+
| | |
+--+--+
direction | | |
staring point ----------------------> +--+--+
| | |
+--+--+
| | |
+--+--+
imagine the grid is perpendicular to the "direction" vector.