Another option, similar to what Tentroic said, is to use a volume shaper of some sort to manually duck the audio of your bass every time the kick drum hits. There are a few ways to do this outside of using a compressor, and depending upon your source audio you might not even want to use one anyways!
A compressor is designed to replace an audio engineer manually riding the volume fader on a track. When working with traditional drum recordings, no two kicks will ever sound completely identical because the drummer isn't a machine and can't strike the beater with the same force or timing each hit - so you'll need a processing solution that can compensate for these types of things. That's where a compressor comes in. If you're using a sampled kick drum, or a kick drum made inside a synthesizer like Kick 2, you'll have a perfect recreation of the same sound, every single time, without fail. Why go through all the work of a compressor, when you know how long the tail will be and can take that into account?
There are solutions that can do this for you, like the
Trackspacer that hennyhuisman mentioned, or like
Peak Rider. If you're not interested in spending that much money,
Kickstart is a fantastic and simplified version of one of the solutions I'm about to recommend - It's only $15 USD, and can run either synced to a specific beat value or (with a little finagling) respond to MIDI input! I actually use Kickstart in a lot of my house, trance, and techno tunes because of how quick and easy it is to just slap on, tweak for ten seconds then move on to the rest of my project.
If you're willing to pay the money, my personal suggestions are either
VolumeShaper - the big brother of Kickstart - or
LFOTool, which is perfect for doing sidechaining but ALSO is a very full featured LFO source for modulating other synthesizers within your DAW.
And if you wanna do it the free way, you can always use Ableton's Utility, Fruity Balance, or whatever other gain control plugin you want to draw in your own volume automation curve and manually create, copy, and paste your ducking as you see fit!