Does the magnetic part of the Lorentz force do work? The magnetic part of the Lorentz force is
$$\vec F_L=q\left(\vec v\times\vec B\right)$$
As this force is always perpendicular to the direction of the movement, we learned that no work is done by it.
However, it's easily observed that permanent magnets attract each other (at least with south pointing to north). This attraction accelerates the magnets in the direction of the movement, so a work is being done. How is this possible?
 A: Easier (for me, at least) than two magnets is two parallel current-carrying wires attracting each other. The force of attraction is equal to the component at right angles to the wire of the magnetic Lorentz force on the charge carriers – the so-called Laplace force.
As soon as the wires start to move together (and work is done on them) the charge carriers' velocity acquires a component at right angles to the wire, and the magnetic Lorentz force acquires a component along the wire. So if the charge carriers are to keep moving at the same speed, work has to be done on them by the electric field set up by the battery; in other words a back-emf has to be overcome. 
So it's the battery that ultimately supplies the work done on the wires as they move together. The magnetic Lorentz force acts a bit like a pulley, changing the direction of the force that does work.
I imagine that the case of two magnets attracting can be analysed in a similar sort of way. But then I do have a vivid imagination...
A: A straightforward, but uncommon, explanation is the following. The Lorentz force expression can be rewritten as $f_k =\frac{d(p+qA)_k} {dt} = qv_i \frac{dA_i} {dx_k} $. When two magnets are near and held at rest, dA/dt=0. An acceleration results in the direction of the gradient of A, proportional to the component of v parallel to A. This force performs work if the separation of the magnets is changed. 
A: The Lorentz force is defined as the total electromagnetic force exerted by an electromagnetic field on an electric point charge. Coming to the magnetic part of lorentz force, it can never do work.

However, it's easily observed that permanent magnets attract each other (at least with south pointing to north). This attraction accelerates the magnets in the direction of the movement, so a work is being done. 

As the definition itself conveys that it is a magnetic force on an electric point charge but magnet is not an electric charge. It's well understood that we can't use lorentz force to define the forces between two magnets.
A: Are you asking how magnets do work? I would say that when you pull magnets appart you are putting potential energy into the system. And when magnets snap back together, the energy is released as sound and heat. 
