How to distinguish between 2 game objects built by a factory?

First off, you need to detect which object you clicked on. You can do that by iterating through your spawned objects and do a simple radius check since you are using spheres.

When you have that object, you can send the force to it. E.g.

local object_hash = factory.create( ... )
...
msg.post(msg.url(nil, object_hash, "collisionobject"), "apply_force", {force = ... })