How the force acts only along the length of the rod? 
Two small balls A and B each of mass $m$ are joined rigidly to the ends of a light rod of length $L$ as in the figure, the system translates on a friction less horizontal surface with a velocity $v$ in a direction perpendicular to the rod, a particle P of mass $m$ kept at rest on the surface sticks to the ball A as the ball collides with it.

I have seen that in this case the light rod will exert a force on the ball B only along its length.
my concern is why the force is exerted only along its length and in what condition it can act in other directions.
 A: 
my concern is why the force is exerted only along its length and in what condition it can act in other directions

In general, a light rigid rod can exert forces with a component perpendicular to its length. This occurs any time there is a non-zero external torque about both of the masses on the ends.
In this specific example, the only external force is applied at A, so the torque about A is 0 and therefore there is no perpendicular component.
Consider a contrary example where an external force is applied to the center of mass of the system, which lies along the rod, with the force applied in the direction perpendicular to the length of the rod. There is a non-zero torque about both masses, and so there is a component of the force that is perpendicular to the length of the rod. The torque about the center of mass is 0, so the torques on each end mass are equal and opposite. So there is no rotation and each end accelerates equally and in parallel, in the direction perpendicular to the length of the rod.
A: 
why the force is exerted only along its length

Let's make two assumptions:


*

*The rod is very "light"

*Nothing interacts with it except the balls at the ends.


If one ball tries to move closer or farther from the other ball, the rod would either have to change length, or it would have to accelerate the other ball to move in the same direction.  So forces along the rod are transmitted to the other ball.
But if one of the balls tries to move perpendicularly, the rod simply rotates around the other.  As the balls are small and the rod is "light", we can consider that there is negligible moment of inertia that would have to be overcome, so no forces are involved.
In reality this is a simplified model, but it's useful.  If you start applying forces to the rod at other locations though (like in the middle), then this doesn't work and the rod must apply forces to the balls in other directions.
A: 
my concern is why the force is exerted only along its length

The problem can be solved by conservation of momentum and conservation of angular momentum. And the answer is that the right after the collision, ball B will be moving with velocity $v_0$, the same as its initially velocity, and ball A will be moving with velocity $v_0/2$. For ball B, there is no acceleration during the collision. For ball A, the acceleration is provided by ball P, because we know that in a perfectly inelastic collision of a system with only ball B and ball P (without the rod), ball B will also be moving with velocity $v_0/2$.

and in what condition it can act in other directions

I have checked that this is also true in the more general case of balls with arbitrary masses $m_A$, $m_B$, $m_P$ and with A and B both initially moving with the same velocity perpendicular to the rod.
I don't have time at the moment and will release this restriction later and post the result here.
