As shown in the image I have two known coordinate pair A and B and few other known coordinate pairs (RED blob) on the graph.
I need to know if any of the other given coordinates fall in line of the ray created by coordinates A and B.
I need some mathematical formula or any appropriate way to know this.
I need to implement the same in code.
Please help!

Suppose your third, unknown point is $C$. If $C-A=n(B-A)$, C is in the ray, where n represents an arbitrary real.
So, an even better way to think of that is to find the slope $\frac{x_b-x_a}{y_b-y_a}$ and see if it is equivalent to the slope $\frac{x_c-x_a}{y_c-y_a}$