After two terrible years on the stock market, solar stocks were hot in 2013. Canadian Solar (CSIQ -0.90%), SunPower (SPWR -3.10%), and SolarCity (SCTY.DL) have all more than quadrupled this year as both financial conditions and investor confidence improved.

Here are the biggest highlights of the year.

China, Japan, and the U.S. emerge
Europe has long been where most solar panels are sold, but this year China, Japan, and the U.S. have emerged as hotspots.

China introduced a plan to build 35 GW of solar by 2015, which will mean more than 10 GW of solar installed for the next two years. Local solar manufacturers such as Trina Solar (NYSE: TSL) and Yingli Green Energy are already beginning to see a large increase in demand for their modules in China.  

Japan has always been a high-potential solar market, but this year demand exploded after the government put a $0.43 per kW-hr feed-in tariff for solar energy. That will result in 7 GW or more installed in the country.  

The U.S. hasn't seen the same short-term explosion in solar being built, but as costs fall, it is growing consistently around the country. GTM Research expects 4.3 GW to be installed in the U.S. this year, up 27% from a year ago.

The encouraging news for the solar industry is that demand is coming from sustainable countries that won't boom and bust the way Spain, Italy, and Greece did in the 2000s. Solar demand is now here for the long haul.

Margins began to improve
Demand for solar modules is great, but if you're selling modules at a loss, it's not good for investors. That's why steady margin increases this year and a slight increase in module sale prices in the past two quarters has been a great sign for the industry.

Following is a table with the gross margins for SunPower, Canadian Solar, and JinkoSolar, which all turned higher margins into a profit. Trina Solar isn't yet profitable, but if margins continue to improve, it has big upside.

FSLR Gross Profit Margin (Quarterly) Chart

FSLR Gross Profit Margin (Quarterly) data by YCharts

The next phase for the solar industry will be building the next generation of manufacturing equipment, so those that can begin generating a profit now will have the flexibility to stay viable long-term.

Costs continue to fall
Solar power has already reached grid parity in many areas around the world, but for it to grow, costs still need to come down, and not just modules, but total system costs. Again, the industry is making progress at a rapid pace.

GTM Research and the Solar Energy Industries Association published a report each quarter, and residential costs were down 9.7% over the past year, commercial costs are down 6.1%, and utility costs are down 15%.

Source: GTM Research.

Utility-scale solar has already become very efficient, but SolarCity is going to be the big driver of cost reductions in residential solar. That's why it purchased Zep Solar earlier this year, to make the installation process more efficient.

Up and down the solar industry, there are efforts to cut costs, and as demand increases, the economies of scale will help drive down the cost of solar.