Do you have any proof that suggests that uses raycasting? Ray casts are basically rays that travel infinitely in one direction until it meets a certain requirement. In this case, I would use a Bézier curve to make a curve like in the example picture but more smooth.
This looks like the module Raycast Hitbox by @TeamSwordphin
That module takes an interesting approach to the hitbox problem. Normally on Roblox, hitboxes are either physical parts that rely on the .Touched event, or region3s, but this thing uses raycasting to create a hitbox. Anything that is within the ray will be hit. It’s definitely more secure than .Touched and seems to be better than region3, though I must confess I have never used it before.
Check out the resource topic for more information about how to use it and stuff.
a ray is a 1 dimensional line. you can change its length, but theres no such thing as its “thickness”.
what are you looking to do? if you just want the visual effect then you dont need to use raycasting. you can just use beams, which you can change the thickness to