@SteveLinton's answer is excellent and I'll just confirm below that its logic and numbers are correct. Then I'll show that you can do it optically as well, but with 10 meter telescopes instead of Arecibos you run into a challenge because each individual light photon carries most of the total received power per second.
Radio
From this answer:
One standard way to estimate how well signals can be sent between points is to use a link budget calculation, where things are in a standardized format so Engineers can understand each part of the link separately, and to share the information with each other.
Since the calculation is a series of multiplications and division, when you use dB, these become addition and subtraction of logarithms. I'm going to leave out the smaller corrections from the big equation shown here since this is an approximate calculation.
$$ P_{RX} = P_{TX} + G_{TX} - L_{FS} + G_{RX} $$
- $P_{RX}$: Received Power
- $P_{TX}$: Transmitted Power
- $G_{TX}$: Gain of Transmitting antenna (compared to isotropic)
- $L_{FS}$: "Free space Loss", what we usually call $1/r^2$ (but also has $R^2 / \lambda^2$) because receive gain is relative to isotropic)
- $G_{RX}$: Gain of Earth's Receiving antenna (compared to isotropic)
$$L_{FS} = 20 \times \log_{10}\left( 4 \pi \frac{R}{\lambda} \right)$$
$$G_{Dish} \sim 20 \times \log_{10}\left( \frac{\pi d}{\lambda} \right)$$
Using 300 meters and 3 cm for an Arecibo antenna at each end as mentioned in the other answer, the gain (over an isotropic antenna) at each end is about 90 dB. The transmit power of 450 kW is 56.5 dBW. 100 light years is 9.5E+17 meters, so $L_{FS}$ is 412 dB.
This gives the Arecibo to Arecibo at 100 Ly, 3 cm, 450 kW received power as
$$P_{RX} = 56.5 + 90 - 412 + 90 = -175.5 \text{dBW}.$$
Assuming a bandwidth $\Delta f$ of 1 Hz as in the other answer, and a receiver front-end temperature of 20 Kelvin (typical for practical Deep Space Network dishes) the NEP (Noise Equivalent Power) would be $k_B T \times \Delta f$ (where $k_B$ is the Boltzmann constant or 1.381E-23 J/K) is only -215.6 dBW, and would be -185.6 dBW for roughy 1 kHz, so @SteveLinton's answer is spot-on!
You can read about the use of Shannon-Hartley in this context in this answer.
Optical Transmission
note: After writing this section I realized that the Sun is going to drown out your signal unless you can find a narrow wavelength range where the Sun's emission is extremely dark. You use a very stable laser wavelength, and you hope that the people 100 light years away use a filter that isolates your laser wavelength taking into account the Doppler shift due to all of the motion between your planet and their planet.
This is extremely unlikely to work, whereas the Sun is going to be much dimmer in a narrow radio band, giving you more room to work with. For more on that see answers to How far have individual stars been seen by radio telescopes?
You can apply the same calculation to an optical link. Using a 10 meter telescope at each end, a 10W laser and a wavelength of 500 nm, you now get gains of 156 dB, a power of 10 dBW, and a path loss of 507.6 dB. The received power is then
$$P_{RX} = 10 + 156 - 507.6 + 156 = -185.6 \text{dBW}.$$
That's surprisingly similar to the radio received power. If you used a temperature-based bolometer to measure the optical signal, you might think that you could do a similar comparison to NEP, but there's a problem because each visible photon carries so much energy.
Doing photon counting and using $E = hc/ \lambda$, the photon energy is about 4E-19 Joules means that -185.6 dBW (about 2.8E-19 Joules/sec) is going to be only about 1.3 photons per second.
This means that if you were simply counting photons per 1 second bin, you wouldn't be able to do 1 kHz, and even 1 Hz would require a lot of statistical analysis.
However there is this answer:
13 bits per photon has been demonstrated with laser communications.
and that's not a fundamental limit. You would use a pulsed laser with the same 10W average power and encode data in the time structure of the pulses, in this case at the millisecond or microsecond level.
Modulate the Sun
This answer links to the open access paper A cloaking device for transiting planets which mentions the use of masks or mirrors to modulate the power of the Sun in a specific direction. I think this is the best way, but it requires superstructures or megastructures and so won't be built any time soon!