When you sit on the beach, the blue sky you see, the warmth you feel and the waves you hear all have their source in the energy of sunlight. Photovoltaic solar cells are a way of converting the energy in sunlight into something other than an enjoyable vacation day. Solar cells convert energy in sunlight into electrical energy. The efficiency of a solar cell is the ratio of the amount of electrical energy it produces to the amount of solar energy that strikes it.
The efficiency of any process is a measure of how well the process works. That is, how much effort you need to put in to get an output. Sometimes efficiency is difficult to quantify, but for solar cells, it's relatively easy. The input to a solar cell is sunlight and the output is electricity. More specifically, the input is energy from sunlight, and the output is energy in electrons.
Photons and Light
On a fundamental level, light consists of tiny packets of energy called photons. At any instant during the day, billions of photons interact with a solar cell. Those photons carry different amounts of energy, depending upon their color. Some photons reflect off a solar cell, some pass through it and some are absorbed. The fate of any given photon depends on its energy -- or, equivalently, its color. It's impossible to predict with certainty the behavior of any one specific photon, but it is possible to calculate the probability of interaction.
The vast majority of solar cells are made from semiconductors. One of the features of semiconductors are energy structures called "bandgaps." Electrons on the low side of the bandgap are trapped in place, while electrons that get an energy boost to the high side of the bandgap are free to move -- including being free to move out of the semiconductor altogether and make themselves useful in electrical circuits. Photons that carry an energy close to the size of the bandgap in a solar cell are the most likely to be absorbed. To calculate the efficiency you need to multiply the energy of every photon by its probability of being absorbed and its probability of making it out of the solar cell into an electrical circuit. That's a fairly complex calculation.
Calculating efficiency from first principles is cumbersome, but if you have the right measurement tools you can make the calculation more easily. With a radiometer you can measure the power density in sunlight. Multiplying the power density by the area of the solar cell provides a measure of the solar energy coming into the solar cell. You take the next step by attaching a circuit with a variable resistor, a current sensor and a voltage sensor. Electrical power is the product of the current and voltage, and it changes depending upon the amount of load the solar cell is driving. So you vary the resistance, calculating power at every step, and find the maximum power point. Divide the maximum electrical power output by the solar power input and you have the solar cell efficiency.