Why does firing employees appear to increase the share price of a company? The last case is GM in the USA. I fail to understand why does this happen. I understand that laying off jobs means higher dividend for the share holder and thus higher stock prices but in the long run is this a viable strategy, doesn't this mean lower income (and thus dividend) for the next quarter or year? Being that not only the employees are being fired but also that the factories are being closed it doesn't seem to me as a case of automation taking over the job. Can someone explain this to me? (I know that GM is allegedly cutting down the production of models non selling well, I am asking in general and not the specific case)
Is firing employees to raise stock prices a good strategy for a
  company?


For the range of scenarios whereby more productivity can be obtained from employees (units of workforce), it certainly is.

By opting for layoffs, a company seeks to get rid of redundant capacity and its associated costs, such as insurance, retirement pensions, or vacations. Since labor is the production factor which can be adjusted in the short-term, the benefit from cutting labor costs is reflected in the company's financial statements quicker than when the company envisions to sell its facilities, real estate, and equipment. Market agents are mindful of that difference, whence they foresee that the company's numbers are about (or are likelier) to improve.

That "strategy" (or, said more properly, tactic) starts to fail where the remaining workforce burns out and/or gets demoralized. These conditions are evidenced in accidents; production failures; product recalls; costs of litigation for unfair labor practices or faulty products; sickness; sudden resignations that cause bottlenecks; and when excessive layoffs render the company unable to meet the demand. It also fails when managers make their firing decisions influenced by personal motives (politics: favoritism, animosity) instead of business-minded criteria.