Now some people make money by reselling patented formulas. Is this illegal? How to deal with it?

The patent right can be transferred, but it can be used by others. There is no problem of illegal or reselling. This is a normal cycle.

If others pass off the patent right as their own technology license, or sell the patent right as their own technology to a third party without the permission of the patentee, this will constitute patent infringement.